pip安装virtualenvwrapper时报错解决方法

使用命令安装virtualenvwrapper时:

pip install virtualenvwrapper

出现如下错误:

Collecting virtualenvwrapper
  Downloading https://files.pythonhosted.org/packages/c1/6b/2f05d73b2d2f2410b48b90d3783a0034c26afa534a4a95ad5f1178d61191/virtualenvwrapper-4.8.4.tar.gz (334kB)
    100% |████████████████████████████████| 337kB 1.7MB/s
    Complete output from command python setup.py egg_info:
    Couldn't find index page for 'pbr' (maybe misspelled?)
    No local packages or download links found for pbr
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/tmp/pip-install-ZU0gb8/virtualenvwrapper/setup.py", line 7, in <module>
        pbr=True,
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 111, in setup
        _setup_distribution = dist = klass(attrs)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/dist.py", line 268, in __init__
        self.fetch_build_eggs(attrs['setup_requires'])
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/dist.py", line 313, in fetch_build_eggs
        replace_conflicting=True,
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 843, in resolve
        dist = best[req.key] = env.best_match(req, ws, installer)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 1088, in best_match
        return self.obtain(req, installer)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 1100, in obtain
        return installer(requirement)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/dist.py", line 380, in fetch_build_egg
        return cmd.easy_install(req)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/command/easy_install.py", line 632, in easy_install
        raise DistutilsError(msg)
    distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('pbr')

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-install-ZU0gb8/virtualenvwrapper/

经过查找发现,好像是源的问题,于是切换成国内的源,运行下面三个命令:

sudo pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pbr

sudo pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --no-deps stevedore

sudo pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --no-deps virtualenvwrapper

运行成功之后,再来运行:

sudo pip install virtualenvwrapper

就可以显示成功安装了。

上一篇:CF1006E - Military Problem(搜索技术+图论+树/省选级)


下一篇:noip模拟83