django-cms-quickstart icon indicating copy to clipboard operation
django-cms-quickstart copied to clipboard

Error Trying to Update `requirements.txt`

Open wesleyboar opened this issue 2 years ago • 0 comments

When I run pip-compile --output-file=requirements.txt requirements.in, I get an error.

Error

    × python setup.py egg_info did not run successfully.
    │ exit code: 1
    ╰─> [25 lines of output]
        /opt/homebrew/Cellar/pip-tools/6.13.0/libexec/lib/python3.11/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
          warnings.warn(msg, warning_class)
        running egg_info
        creating /private/var/folders/dc/zbpxqspx1835__8gfbwrwl_c0000gp/T/pip-pip-egg-info-c1pq6gf_/psycopg2.egg-info
        writing /private/var/folders/dc/zbpxqspx1835__8gfbwrwl_c0000gp/T/pip-pip-egg-info-c1pq6gf_/psycopg2.egg-info/PKG-INFO
        writing dependency_links to /private/var/folders/dc/zbpxqspx1835__8gfbwrwl_c0000gp/T/pip-pip-egg-info-c1pq6gf_/psycopg2.egg-info/dependency_links.txt
        writing top-level names to /private/var/folders/dc/zbpxqspx1835__8gfbwrwl_c0000gp/T/pip-pip-egg-info-c1pq6gf_/psycopg2.egg-info/top_level.txt
        writing manifest file '/private/var/folders/dc/zbpxqspx1835__8gfbwrwl_c0000gp/T/pip-pip-egg-info-c1pq6gf_/psycopg2.egg-info/SOURCES.txt'
        
        Error: pg_config executable not found.
        
        pg_config is required to build psycopg2 from source.  Please add the directory
        containing pg_config to the $PATH or specify the full executable path with the
        option:
        
            python setup.py build_ext --pg-config /path/to/pg_config build ...
        
        or with the pg_config option in 'setup.cfg'.
        
        If you prefer to avoid building psycopg2 from source, please install the PyPI
        'psycopg2-binary' package instead.
        
        For further information please check the 'doc/src/install.rst' file (also at
        <https://www.psycopg.org/docs/install.html>).
        
        [end of output]
    
    note: This error originates from a subprocess, and is likely not a problem with pip.
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/pip-tools/6.13.0/libexec/lib/python3.11/site-packages/pip/_internal/operations/build/metadata_legacy.py", line 64, in generate_metadata
    call_subprocess(
  File "/opt/homebrew/Cellar/pip-tools/6.13.0/libexec/lib/python3.11/site-packages/pip/_internal/utils/subprocess.py", line 224, in call_subprocess
    raise error
pip._internal.exceptions.InstallationSubprocessError: python setup.py egg_info exited with 1

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/homebrew/bin/pip-compile", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/opt/homebrew/Cellar/pip-tools/6.13.0/libexec/lib/python3.11/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pip-tools/6.13.0/libexec/lib/python3.11/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pip-tools/6.13.0/libexec/lib/python3.11/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pip-tools/6.13.0/libexec/lib/python3.11/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pip-tools/6.13.0/libexec/lib/python3.11/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pip-tools/6.13.0/libexec/lib/python3.11/site-packages/piptools/scripts/compile.py", line 592, in cli
    results = resolver.resolve(max_rounds=max_rounds)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pip-tools/6.13.0/libexec/lib/python3.11/site-packages/piptools/resolver.py", line 253, in resolve
    has_changed, best_matches = self._resolve_one_round()
                                ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pip-tools/6.13.0/libexec/lib/python3.11/site-packages/piptools/resolver.py", line 343, in _resolve_one_round
    their_constraints.extend(self._iter_dependencies(best_match))
  File "/opt/homebrew/Cellar/pip-tools/6.13.0/libexec/lib/python3.11/site-packages/piptools/resolver.py", line 456, in _iter_dependencies
    dependencies = self.repository.get_dependencies(ireq)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pip-tools/6.13.0/libexec/lib/python3.11/site-packages/piptools/repositories/local.py", line 87, in get_dependencies
    return self.repository.get_dependencies(ireq)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pip-tools/6.13.0/libexec/lib/python3.11/site-packages/piptools/repositories/pypi.py", line 242, in get_dependencies
    self._dependencies_cache[ireq] = self.resolve_reqs(
                                     ^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pip-tools/6.13.0/libexec/lib/python3.11/site-packages/piptools/repositories/pypi.py", line 202, in resolve_reqs
    results = resolver._resolve_one(reqset, ireq)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pip-tools/6.13.0/libexec/lib/python3.11/site-packages/pip/_internal/resolution/legacy/resolver.py", line 509, in _resolve_one
    dist = self._get_dist_for(req_to_install)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pip-tools/6.13.0/libexec/lib/python3.11/site-packages/pip/_internal/resolution/legacy/resolver.py", line 462, in _get_dist_for
    dist = self.preparer.prepare_linked_requirement(req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pip-tools/6.13.0/libexec/lib/python3.11/site-packages/pip/_internal/operations/prepare.py", line 491, in prepare_linked_requirement
    return self._prepare_linked_requirement(req, parallel_builds)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pip-tools/6.13.0/libexec/lib/python3.11/site-packages/pip/_internal/operations/prepare.py", line 577, in _prepare_linked_requirement
    dist = _get_prepared_distribution(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pip-tools/6.13.0/libexec/lib/python3.11/site-packages/pip/_internal/operations/prepare.py", line 69, in _get_prepared_distribution
    abstract_dist.prepare_distribution_metadata(
  File "/opt/homebrew/Cellar/pip-tools/6.13.0/libexec/lib/python3.11/site-packages/pip/_internal/distributions/sdist.py", line 61, in prepare_distribution_metadata
    self.req.prepare_metadata()
  File "/opt/homebrew/Cellar/pip-tools/6.13.0/libexec/lib/python3.11/site-packages/pip/_internal/req/req_install.py", line 541, in prepare_metadata
    self.metadata_directory = generate_metadata_legacy(
                              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/pip-tools/6.13.0/libexec/lib/python3.11/site-packages/pip/_internal/operations/build/metadata_legacy.py", line 71, in generate_metadata
    raise MetadataGenerationFailed(package_details=details) from error
pip._internal.exceptions.MetadataGenerationFailed: metadata generation failed

Resolution I Found

I changed psycopg2==2.8.5 to psycopg2-binary==2.9.6 in requirements.in. See:

  • https://github.com/wesleyboar/django-cms-quickstart/pull/4

Questions

  1. Is this a problem on my system?
  2. Is there a more appropriate way to solve this?

wesleyboar avatar Jun 08 '23 19:06 wesleyboar