提问者:小点点

命令"pythonsetup.pyegg_info"失败,错误代码1在/tmp/……/


我在使用pip安装依赖项时遇到以下错误:

安装错误命令"pythonsetup.pyegg_info"失败与错误代码1在 /tmp/tmpoons7qgkbuild/opencv-python/

以下是在最近的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/

共3个答案

匿名用户

确保您的pipsetuptools的版本足以用于manylinux2014轮子

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

对我来说,pythonsetup.pyegg_info可能是因为python轮子最近发生了变化而失败的,因为manylinux1轮子manylinux2014轮子替换了。

匿名用户

我解决了类似的问题后,此链接https://www.edureka.co/community/69396/command-python-setup-info-failed-error-build-8nhf9w2t-grpcio并使用以下命令:

$ pip3 install --upgrade setuptools
$ pip3 install --upgrade pip

匿名用户

我只是遇到了一个类似的问题,当试图安装谷歌云平台包BigQuery在Python3.6这抛给我以下错误:(无法复制和粘贴之前,我失去了它,所以这是我得到的确切错误的近似值)

[…]InstallationError:命令"pythonsetup.pyegg_info"失败,错误代码1在 /tmp/

在使用最推荐的选项升级setuptools的其他线程之后,不使用缓存的包,使用本地用户选项等…没有任何效果

python3 -m pip install --user --no-cache-dir google-cloud-bigquery
python3 -m pip install --upgrade setuptools

然后,当更仔细地查看实际错误消息时,我可以看到失败行也指的是我认为可能是另一个依赖包:grpcio

当然,我想也尝试升级或重新安装grpcio包,看看会发生什么。

我首先尝试升级该包:

python3 -m pip install --no-cache-dir --user --upgrade grpcio

它确实升级得很好。所以接下来我尝试再次升级google-cloud-bigquery包,这次它也运行得很好,解决了问题!

所以基本上,确保整个依赖链可用并正确安装似乎也可以做到这一点,当你考虑它时,这是完全有意义的

我希望这能帮助一些人。