在执行 pip install 时遇到错误: ERROR: Complete output from command python setup.py egg_info:

在执行 pip install 时遇到错误:
~]# pip install -U docker-compose

 .................
 ERROR: Complete output from command python setup.py egg_info:
 ERROR: Traceback (most recent call last):
  File "", line 1, in 
  File "/tmp/pip-install-XPRUHU/pycparser/setup.py", line 65, in 
    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 "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-XPRUHU/pycparser/

解决方法是更新 setuptools 和 pip即可:
~]# pip install --upgrade setuptools && python -m pip install --upgrade pip

你可能感兴趣的:(linux知识集,python)