无法使用 pipenv 成功安装 VCS 包

Cannot install VCS package successfully using pipenv

在 github 上有一个我正在尝试使用 pipenv 安装的包。

我正在尝试这样安装软件包:

pipenv install -e git+https://github.com/arepo/atotallyworking-python-package.git@v1.0.0#egg=atotallyworking-python-package.git

需要说明的是,使用 requirements.txt 文件通过 virtualenvpip 安装此软件包时没有任何问题。

包添加到 Pipfile 第一次没有问题。

然后当我返回并尝试在 Pipfile 文件中安装依赖项时,例如使用一个新的项目克隆,其中包括 Pipfile 中的 github 包,如下所示:

atotallyworking-python-package = {editable = true,git = "https://github.com/arepot/atotallyworking-python-package.git",ref = "v1.0.0"}  

它因以下错误而爆炸:

Traceback (most recent call last):

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/resolver.py", line 126, in <module>

main()

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/resolver.py", line 119, in main

parsed.requirements_dir, parsed.packages)

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/resolver.py", line 85, in _main

requirements_dir=requirements_dir,

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/resolver.py", line 69, in resolve

req_dir=requirements_dir

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/utils.py", line 726, in resolve_deps

req_dir=req_dir,

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps

resolved_tree = resolver.resolve()

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/utils.py", line 385, in resolve

results = self.resolver.resolve(max_rounds=environments.PIPENV_MAX_ROUNDS)

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/patched/piptools/resolver.py", line 102, in resolve

has_changed, best_matches = self._resolve_one_round()

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/patched/piptools/resolver.py", line 206, in _resolve_one_round

for dep in self._iter_dependencies(best_match):

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/patched/piptools/resolver.py", line 280, in _iter_dependencies

for dependency in self.repository.get_dependencies(ireq):

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 234, in get_dependencies

legacy_results = self.get_legacy_dependencies(ireq)

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/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 "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 297, in resolve_reqs

results = resolver._resolve_one(reqset, ireq)

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/patched/notpip/_internal/resolve.py", line 260, in _resolve_one

abstract_dist = self._get_abstract_dist_for(req_to_install)

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/patched/notpip/_internal/resolve.py", line 197, in _get_abstract_dist_for

req, self.require_hashes, self.use_user_site, self.finder,

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/patched/notpip/_internal/operations/prepare.py", line 321, in prepare_editable_requirement

abstract_dist.prep_for_dist(finder, self.build_isolation)

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/patched/notpip/_internal/operations/prepare.py", line 127, in prep_for_dist

self.req.run_egg_info()

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/patched/notpip/_internal/req/req_install.py", line 474, in run_egg_info

command_desc='python setup.py egg_info')

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/patched/notpip/_internal/utils/misc.py", line 705, in call_subprocess

% (command_desc, proc.returncode, cwd))

pipenv.patched.notpip._internal.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /var/folders/60/cbz9nv2s4tx9c380cl4mmw140000gq/T/tmpsc9waggasource/atotallyworking-python-package/

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/resolver.py", line 126, in <module>

main()

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/resolver.py", line 119, in main

parsed.requirements_dir, parsed.packages)

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/resolver.py", line 85, in _main

requirements_dir=requirements_dir,

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/resolver.py", line 69, in resolve

req_dir=requirements_dir

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/utils.py", line 726, in resolve_deps

req_dir=req_dir,

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps

resolved_tree = resolver.resolve()

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/utils.py", line 385, in resolve

results = self.resolver.resolve(max_rounds=environments.PIPENV_MAX_ROUNDS)

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/patched/piptools/resolver.py", line 102, in resolve

has_changed, best_matches = self._resolve_one_round()

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/patched/piptools/resolver.py", line 206, in _resolve_one_round

for dep in self._iter_dependencies(best_match):

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/patched/piptools/resolver.py", line 280, in _iter_dependencies

for dependency in self.repository.get_dependencies(ireq):

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 234, in get_dependencies

legacy_results = self.get_legacy_dependencies(ireq)

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/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 "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 297, in resolve_reqs

results = resolver._resolve_one(reqset, ireq)

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/patched/notpip/_internal/resolve.py", line 260, in _resolve_one

abstract_dist = self._get_abstract_dist_for(req_to_install)

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/patched/notpip/_internal/resolve.py", line 197, in _get_abstract_dist_for

req, self.require_hashes, self.use_user_site, self.finder,

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/patched/notpip/_internal/operations/prepare.py", line 321, in prepare_editable_requirement

abstract_dist.prep_for_dist(finder, self.build_isolation)

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/patched/notpip/_internal/operations/prepare.py", line 127, in prep_for_dist

self.req.run_egg_info()

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/patched/notpip/_internal/req/req_install.py", line 474, in run_egg_info

command_desc='python setup.py egg_info')

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pipenv/patched/notpip/_internal/utils/misc.py", line 705, in call_subprocess

% (command_desc, proc.returncode, cwd))

pipenv.patched.notpip._internal.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /var/folders/60/cbz9nv2s4tx9c380cl4mmw140000gq/T/tmpsc9waggasource/atotallyworking-python-package/

知道我在这里做错了什么或者这个堆栈跟踪表明什么吗?

在我运行以下命令之后,这个问题似乎得到了解决:

pipenv --skip-lock
pipenv lock

然后,当我带着 repo 的新副本返回并重新安装所有内容时,一切都很好,通过 pipenv install 安装时 VCS 依赖项没有问题。