导入错误:模块对象没有属性' check_specifier'错误

时间:2018-04-19 10:31:59

标签: python pip virtualenv tornado setuptools

在我的Buildbot虚拟环境中,我一直面临着安装龙卷风的奇怪错误,龙卷风是sphinx-autobuild==0.6.0的依赖。

>>> pip install --upgrade sphinx-autobuild==0.6.0

Collecting tornado>=3.2 (from sphinx-autobuild==0.6.0->-r towerportal/requirements.txt (line 76))
Using cached https://files.pythonhosted.org/packages/cf/d1/3be271ae5eba9fb59df63c9891fdc7d8044b999e8ac145994cdbfd2ae66a/tornado-5.0.2.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-build-Bpw6k7/tornado/setup.py", line 192, in <module>
    **kwargs
  File "/spare/local/buildslave/.pyenv/versions/2.7.12/lib/python2.7/distutils/core.py", line 111, in setup
    _setup_distribution = dist = klass(attrs)
  File "/spare/local/buildslave/slaveA/demoA/build/virt/lib/python2.7/site-packages/setuptools/dist.py", line 269, in __init__
    _Distribution.__init__(self,attrs)
  File "/spare/local/buildslave/.pyenv/versions/2.7.12/lib/python2.7/distutils/dist.py", line 287, in __init__
    self.finalize_options()
  File "/spare/local/buildslave/slaveA/demoA/build/virt/lib/python2.7/site-packages/setuptools/dist.py", line 325, in finalize_options
    ep.load()(self, ep.name, value)
  File "/spare/local/buildslave/slaveA/demoA/build/virt/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2310, in load
    return self.resolve()
  File "/spare/local/buildslave/slaveA/demoA/build/virt/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2320, in resolve
    raise ImportError(str(exc))
ImportError: 'module' object has no attribute 'check_specifier'

我的setuptools版本是39.0.1。幸运的是,使用pip install -I setuptools重新安装setuptools可以解决问题。但我真正的问题是,重新安装具有相同版本名称的相同软件包真的会发生什么变化才能解决问题?是否setuptools错误地发布了相同版本的不同代码库?

0 个答案:

没有答案