当前位置: 首页 > 工具软件 > Py3Cache > 使用案例 >

pip install报python setup.py egg_info Check the logs for full command output.

霍鸣
2023-12-01

错误信息

pip install nvidia-pyindex
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Processing ./nvidia-pyindex-1.0.3.tar.gz
    ERROR: Command errored out with exit status 1:
     command: /root/anaconda3/envs/cv_1/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-g8mw0woq/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-g8mw0woq/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-celokapk
         cwd: /tmp/pip-req-build-g8mw0woq/
    Complete output (23 lines):
    Couldn't find index page for 'appdirs' (maybe misspelled?)
    No local packages or working download links found for appdirs<1.5,>=1.4
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-g8mw0woq/setup.py", line 201, in <module>
        packages=find_packages(),
      File "/root/anaconda3/envs/cv_1/lib/python3.6/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/root/anaconda3/envs/cv_1/lib/python3.6/site-packages/setuptools/dist.py", line 335, in __init__
        self.fetch_build_eggs(attrs['setup_requires'])
      File "/root/anaconda3/envs/cv_1/lib/python3.6/site-packages/setuptools/dist.py", line 456, in fetch_build_eggs
        replace_conflicting=True,
      File "/root/anaconda3/envs/cv_1/lib/python3.6/site-packages/pkg_resources/__init__.py", line 863, in resolve
        replace_conflicting=replace_conflicting
      File "/root/anaconda3/envs/cv_1/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1141, in best_match
        return self.obtain(req, installer)
      File "/root/anaconda3/envs/cv_1/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1153, in obtain
        return installer(requirement)
      File "/root/anaconda3/envs/cv_1/lib/python3.6/site-packages/setuptools/dist.py", line 522, in fetch_build_egg
        return cmd.easy_install(req)
      File "/root/anaconda3/envs/cv_1/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 666, in easy_install
        raise DistutilsError(msg)
    distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('appdirs<1.5,>=1.4')
    ----------------------------------------
WARNING: Discarding file:///root/nvidia-pyindex-1.0.3.tar.gz. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

解决办法

  • 升级setuptools
pip install -U setuptools
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: setuptools in ./anaconda3/envs/cv_1/lib/python3.6/site-packages (36.4.0)
Collecting setuptools
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/bd/25/5bdf7f1adeebd4e3fa76b2e2f045ae53ee208e40a4231ad0f0c3007e4353/setuptools-57.4.0-py3-none-any.whl (819 kB)
     |████████████████████████████████| 819 kB 2.6 MB/s 
Installing collected packages: setuptools
  Attempting uninstall: setuptools
    Found existing installation: setuptools 36.4.0
    Uninstalling setuptools-36.4.0:
      Successfully uninstalled setuptools-36.4.0
Successfully installed setuptools-57.4.0
  • 重新安装
pip install nvidia-pyindex
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Processing ./nvidia-pyindex-1.0.3.tar.gz
Building wheels for collected packages: nvidia-pyindex
  Building wheel for nvidia-pyindex (setup.py) ... done
  Created wheel for nvidia-pyindex: filename=nvidia_pyindex-1.0.3-py3-none-any.whl size=4939 sha256=be863900d7d5d7355b1c441d4846f1da6322f7625535119bccedbb25a001e3f7
  Stored in directory: /root/.cache/pip/wheels/81/77/21/49329a0618a9ca58a39eea7fe20d854e5390be47c5b255caf0
Successfully built nvidia-pyindex
Installing collected packages: nvidia-pyindex
Successfully installed nvidia-pyindex-1.0.3

参考:

  1. https://github.com/palantir/python-language-server/issues/370
 类似资料: