命令“python setup.py egg_info”失败,错误代码为 1 in /tmp/..../

新手上路,请多包涵

使用 pip 安装依赖项时出现以下错误:

pip9.exceptions.InstallationError 命令“python setup.py egg_info”在 /tmp/tmpoons7qgkbuild/opencv-python/ 中失败,错误代码为 1

下面是在最近的 linux (5.4.0 x64) 系统上运行命令 pipenv install opencv-python 的结果。

 Locking [packages] dependencies…
self.repository.get_dependencies(ireq):
  File "/usr/lib/python3/dist-packages/pipenv/patched/piptools/repositories/pypi.py", line 174, in get_dependencies
    legacy_results = self.get_legacy_dependencies(ireq)
  File "/usr/lib/python3/dist-packages/pipenv/patched/piptools/repositories/pypi.py", line 222, in get_legacy_dependencies
    result = reqset._prepare_file(self.finder, ireq, ignore_requires_python=True)
  File "/usr/lib/python3/dist-packages/pipenv/patched/notpip/req/req_set.py", line 644, in _prepare_file
    abstract_dist.prep_for_dist()
  File "/usr/lib/python3/dist-packages/pipenv/patched/notpip/req/req_set.py", line 134, in prep_for_dist
    self.req_to_install.run_egg_info()
  File "/usr/lib/python3/dist-packages/pipenv/vendor/pip9/req/req_install.py", line 435, in run_egg_info
    call_subprocess(
  File "/usr/lib/python3/dist-packages/pipenv/vendor/pip9/utils/__init__.py", line 705, in call_subprocess
    raise InstallationError(
pip9.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/tmpoons7qgkbuild/opencv-python/

原文由 Semnodime 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 1k
2 个回答

如何修复 pip9.exceptions.InstallationError

确保 pipsetuptools 的版本足以满足 manylinux2014 wheels

A) 系统安装

sudo python3 -m pip install -U pip
sudo python3 -m pip install -U setuptools

B) 虚拟环境/Pipenv

 # Within the venv
pip3 install -U pip
pip3 install -U setuptools

解释

对我来说, python setup.py egg_info 可能因为python轮子最近的变化而失败,因为 manylinux1 wheels 被替换为 manylinux2014 wheels 根据 open-cv faq

原文由 Semnodime 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题