python ERROR: Command errored out with exit status 1:

在使用$$后端一键脚本时遇到这个错误,python在安装第三方库报错。可能是网络问题造成的,解决方法在下面更新 pip 后在执行脚本一次;

ERROR: Command errored out with exit status 1:
     command: /usr/bin/python2 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-2rUisu/pycparser/setup.py'"'"'; __file__='"'"'/tmp/pip-install-2rUisu/pycparser/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
         cwd: /tmp/pip-install-2rUisu/pycparser/
    Complete output (17 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-2rUisu/pycparser/setup.py", line 65, in <module>
        cmdclass={'install': install, 'sdist': sdist},
      File "/usr/lib64/python2.7/distutils/core.py", line 112, in setup
        _setup_distribution = dist = klass(attrs)
      File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 269, in __init__
        _Distribution.__init__(self,attrs)
      File "/usr/lib64/python2.7/distutils/dist.py", line 287, in __init__
        self.finalize_options()
      File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 302, in finalize_options
        ep.load()(self, ep.name, value)
      File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2341, in load
        return self.resolve()
      File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2351, in resolve
        raise ImportError(str(exc))
    ImportError: 'module' object has no attribute 'check_specifier'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

解决方法

pip install --upgrade  pip     # 升级pip;
pip install setuptools    # 安装setuptools;

如果出现以下错误:

ERROR:Cannot uninstall 'requests'.It is a distutils installed project and thus we cannot acurately determine which files belog to it which would lead to only apartial uninstall.

解决方法

pip install --ignore-installed requests
相关推荐
python ERROR: Command errored out with exit status 1:
Windows Server 2019 域环境搭建 SMB 共享文件服务
Windows Server 2016 搭建 SMB 共享文件
Parallels Desktop 15.1.3