Pipenv не удалось заблокировать с помощью psycopg2-бинарного файла - PullRequest
0 голосов
/ 23 февраля 2020

Я пытаюсь создать виртуальную среду для django разработки. Я успешно смог установить psycopg2-бинарный файл в другом проекте, но не смог воспроизвести успешную установку.

Среда:

  1. Python 3.8.1
  2. Версия Pipenv 2018.11.26

Шаги для установки:

mkdir test && cd test
pipenv install django psycopg2-binary==2.8.4

На ходу:

Installing psycopg2-binary==2.8.4…
Adding psycopg2-binary to Pipfile's [packages]…
Installation Succeeded
Pipfile.lock (24bc11) out of date, updating to (a6086c)…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Locking Failed!
Traceback (most recent call last):
  File "c:/users/optiplex 3020/appdata/local/programs/python/python38-32/lib/site-packages/pipenv/resolver.py", line 126, in <module>
    main()
  File "c:/users/optiplex 3020/appdata/local/programs/python/python38-32/lib/site-packages/pipenv/resolver.py", line 118, in main
    _main(parsed.pre, parsed.clear, parsed.verbose, parsed.system,
  File "c:/users/optiplex 3020/appdata/local/programs/python/python38-32/lib/site-packages/pipenv/resolver.py", line 78, in _main
    results = resolve(
  File "c:/users/optiplex 3020/appdata/local/programs/python/python38-32/lib/site-packages/pipenv/resolver.py", line 61, in resolve
    return resolve_deps(
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\utils.py", line 718, in resolve_deps
    resolved_tree, hashes, markers_lookup, resolver = actually_resolve_deps(
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\utils.py", line 480, in actually_resolve_deps
    resolved_tree = resolver.resolve()
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\utils.py", line 385, in resolve
    results = self.resolver.resolve(max_rounds=environments.PIPENV_MAX_ROUNDS)
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\piptools\resolver.py", line 102, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\piptools\resolver.py", line 206, in _resolve_one_round
    for dep in self._iter_dependencies(best_match):
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\piptools\resolver.py", line 301, in _iter_dependencies
    dependencies = self.repository.get_dependencies(ireq)
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\piptools\repositories\pypi.py", line 234, in get_dependencies
    legacy_results = self.get_legacy_dependencies(ireq)
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\piptools\repositories\pypi.py", line 426, in get_legacy_dependencies
    results, ireq = self.resolve_reqs(download_dir, ireq, wheel_cache)
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\piptools\repositories\pypi.py", line 297, in resolve_reqs
    results = resolver._resolve_one(reqset, ireq)
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\resolve.py", line 260, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\resolve.py", line 211, in _get_abstract_dist_for
    abstract_dist = self.preparer.prepare_linked_requirement(
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\operations\prepare.py", line 294, in prepare_linked_requirement
    abstract_dist.prep_for_dist(finder, self.build_isolation)
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\operations\prepare.py", line 127, in prep_for_dist
    self.req.run_egg_info()
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\req\req_install.py", line 470, in run_egg_info
    call_subprocess(
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\utils\misc.py", line 703, in call_subprocess
    raise InstallationError(
pipenv.patched.notpip._internal.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in C:\Users\OPTIPL~1\AppData\Local\Temp\tmp3guv6vnobuild\psycopg2-binary\
File "c:/users/optiplex 3020/appdata/local/programs/python/python38-32/lib/site-packages/pipenv/resolver.py", line 126, in <module>
    main()
  File "c:/users/optiplex 3020/appdata/local/programs/python/python38-32/lib/site-packages/pipenv/resolver.py", line 118, in main
    _main(parsed.pre, parsed.clear, parsed.verbose, parsed.system,
  File "c:/users/optiplex 3020/appdata/local/programs/python/python38-32/lib/site-packages/pipenv/resolver.py", line 78, in _main
    results = resolve(
  File "c:/users/optiplex 3020/appdata/local/programs/python/python38-32/lib/site-packages/pipenv/resolver.py", line 61, in resolve
    return resolve_deps(
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\utils.py", line 718, in resolve_deps
    resolved_tree, hashes, markers_lookup, resolver = actually_resolve_deps(
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\utils.py", line 480, in actually_resolve_deps
    resolved_tree = resolver.resolve()
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\utils.py", line 385, in resolve
    results = self.resolver.resolve(max_rounds=environments.PIPENV_MAX_ROUNDS)
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\piptools\resolver.py", line 102, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\piptools\resolver.py", line 206, in _resolve_one_round
    for dep in self._iter_dependencies(best_match):
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\piptools\resolver.py", line 301, in _iter_dependencies
    dependencies = self.repository.get_dependencies(ireq)
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\piptools\repositories\pypi.py", line 234, in get_dependencies
    legacy_results = self.get_legacy_dependencies(ireq)
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\piptools\repositories\pypi.py", line 426, in get_legacy_dependencies
    results, ireq = self.resolve_reqs(download_dir, ireq, wheel_cache)
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\piptools\repositories\pypi.py", line 297, in resolve_reqs
    results = resolver._resolve_one(reqset, ireq)
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\resolve.py", line 260, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\resolve.py", line 211, in _get_abstract_dist_for
    abstract_dist = self.preparer.prepare_linked_requirement(
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\operations\prepare.py", line 294, in prepare_linked_requirement
    abstract_dist.prep_for_dist(finder, self.build_isolation)
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\operations\prepare.py", line 127, in prep_for_dist
    self.req.run_egg_info()
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\req\req_install.py", line 470, in run_egg_info
    call_subprocess(
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\utils\misc.py", line 703, in call_subprocess
    raise InstallationError(
pipenv.patched.notpip._internal.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in C:\Users\OPTIPL~1\AppData\Local\Temp\tmp3guv6vnobuild\psycopg2-binary\

Попытки решения:

Удаление кэша в% LOCALDATA% \ AppData \ Local \ pipenv \ pipenv

pipenv lock --clear
pipenv lock -v

Вывод pipenv lock -v :

Locking [dev-packages] dependencies…
Locking [packages] dependencies…
Locking Failed!
Using pip: -i https://pypi.org/simple
Using pip: -i https://pypi.org/simple
Using pip: -i https://pypi.org/simple

                          ROUND 1
Current constraints:
  django
  psycopg2-binary==2.8.4

Finding the best candidates:
  found candidate django==3.0.3 (constraint was <any>)
  found candidate psycopg2-binary==2.8.4 (constraint was ==2.8.4)

Finding secondary dependencies:
  django==3.0.3 not in cache, need to check index
  django==3.0.3             requires asgiref~=3.2, pytz, sqlparse>=0.2.2
  psycopg2-binary==2.8.4 not in cache, need to check index
Traceback (most recent call last):
  File "c:/users/optiplex 3020/appdata/local/programs/python/python38-32/lib/site-packages/pipenv/resolver.py", line 126, in <module>
    main()
  File "c:/users/optiplex 3020/appdata/local/programs/python/python38-32/lib/site-packages/pipenv/resolver.py", line 118, in main
    _main(parsed.pre, parsed.clear, parsed.verbose, parsed.system,
  File "c:/users/optiplex 3020/appdata/local/programs/python/python38-32/lib/site-packages/pipenv/resolver.py", line 78, in _main
    results = resolve(
  File "c:/users/optiplex 3020/appdata/local/programs/python/python38-32/lib/site-packages/pipenv/resolver.py", line 61, in resolve
    return resolve_deps(
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\utils.py", line 718, in resolve_deps
    resolved_tree, hashes, markers_lookup, resolver = actually_resolve_deps(
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\utils.py", line 480, in actually_resolve_deps
    resolved_tree = resolver.resolve()
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\utils.py", line 385, in resolve
    results = self.resolver.resolve(max_rounds=environments.PIPENV_MAX_ROUNDS)
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\piptools\resolver.py", line 102, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\piptools\resolver.py", line 206, in _resolve_one_round
    for dep in self._iter_dependencies(best_match):
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\piptools\resolver.py", line 301, in _iter_dependencies
    dependencies = self.repository.get_dependencies(ireq)
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\piptools\repositories\pypi.py", line 234, in get_dependencies
    legacy_results = self.get_legacy_dependencies(ireq)
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\piptools\repositories\pypi.py", line 426, in get_legacy_dependencies
    results, ireq = self.resolve_reqs(download_dir, ireq, wheel_cache)
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\piptools\repositories\pypi.py", line 297, in resolve_reqs
    results = resolver._resolve_one(reqset, ireq)
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\resolve.py", line 260, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\resolve.py", line 211, in _get_abstract_dist_for
    abstract_dist = self.preparer.prepare_linked_requirement(
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\operations\prepare.py", line 294, in prepare_linked_requirement
    abstract_dist.prep_for_dist(finder, self.build_isolation)
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\operations\prepare.py", line 127, in prep_for_dist
    self.req.run_egg_info()
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\req\req_install.py", line 470, in run_egg_info
    call_subprocess(
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\utils\misc.py", line 703, in call_subprocess
    raise InstallationError(
pipenv.patched.notpip._internal.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in C:\Users\OPTIPL~1\AppData\Local\Temp\tmpzbo1k1mpbuild\psycopg2-binary\
Using pip: -i https://pypi.org/simple
Using pip: -i https://pypi.org/simple

                          ROUND 1
Current constraints:
  django
  psycopg2-binary==2.8.4

Finding the best candidates:
  found candidate django==3.0.3 (constraint was <any>)
  found candidate psycopg2-binary==2.8.4 (constraint was ==2.8.4)

Finding secondary dependencies:
  django==3.0.3 not in cache, need to check index
  django==3.0.3             requires asgiref~=3.2, pytz, sqlparse>=0.2.2
  psycopg2-binary==2.8.4 not in cache, need to check index
Traceback (most recent call last):
  File "c:/users/optiplex 3020/appdata/local/programs/python/python38-32/lib/site-packages/pipenv/resolver.py", line 126, in <module>
    main()
  File "c:/users/optiplex 3020/appdata/local/programs/python/python38-32/lib/site-packages/pipenv/resolver.py", line 118, in main
    _main(parsed.pre, parsed.clear, parsed.verbose, parsed.system,
  File "c:/users/optiplex 3020/appdata/local/programs/python/python38-32/lib/site-packages/pipenv/resolver.py", line 78, in _main
    results = resolve(
  File "c:/users/optiplex 3020/appdata/local/programs/python/python38-32/lib/site-packages/pipenv/resolver.py", line 61, in resolve
    return resolve_deps(
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\utils.py", line 718, in resolve_deps
    resolved_tree, hashes, markers_lookup, resolver = actually_resolve_deps(
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\utils.py", line 480, in actually_resolve_deps
    resolved_tree = resolver.resolve()
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\utils.py", line 385, in resolve
    results = self.resolver.resolve(max_rounds=environments.PIPENV_MAX_ROUNDS)
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\piptools\resolver.py", line 102, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\piptools\resolver.py", line 206, in _resolve_one_round
    for dep in self._iter_dependencies(best_match):
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\piptools\resolver.py", line 301, in _iter_dependencies
    dependencies = self.repository.get_dependencies(ireq)
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\piptools\repositories\pypi.py", line 234, in get_dependencies
    legacy_results = self.get_legacy_dependencies(ireq)
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\piptools\repositories\pypi.py", line 426, in get_legacy_dependencies
    results, ireq = self.resolve_reqs(download_dir, ireq, wheel_cache)
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\piptools\repositories\pypi.py", line 297, in resolve_reqs
    results = resolver._resolve_one(reqset, ireq)
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\resolve.py", line 260, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\resolve.py", line 211, in _get_abstract_dist_for
    abstract_dist = self.preparer.prepare_linked_requirement(
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\operations\prepare.py", line 294, in prepare_linked_requirement
    abstract_dist.prep_for_dist(finder, self.build_isolation)
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\operations\prepare.py", line 127, in prep_for_dist
    self.req.run_egg_info()
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\req\req_install.py", line 470, in run_egg_info
    call_subprocess(
  File "c:\users\optiplex 3020\appdata\local\programs\python\python38-32\lib\site-packages\pipenv\patched\notpip\_internal\utils\misc.py", line 703, in call_subprocess
    raise InstallationError(
pipenv.patched.notpip._internal.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in C:\Users\OPTIPL~1\AppData\Local\Temp\tmpzbo1k1mpbuild\psycopg2-binary\

У кого-нибудь еще была подобная проблема? Я склоняюсь к тому, что проблема заключается в том, как я пытаюсь решить блокировку pipenv, так как вчера у меня не было этой проблемы.

1 Ответ

0 голосов
/ 03 марта 2020

Я решил эту проблему, используя эту ветку: https://github.com/pypa/pipenv/issues/3468

По общему мнению, pipenv не поддерживает 3.8.1, с тех пор я понизил его до 3.7.6 и буду использовать это пока не будет оказана поддержка.

...