最新的'pip'失败,“需要setuptools> = 0.8 for dist-info”

时间:2014-01-03 14:00:42

标签: python pip setuptools python-wheel

使用pip的最新版本(1.5),尝试更新多个软件包时出错。例如,sudo pip install -U pytz导致失败:

Wheel installs require setuptools >= 0.8 for dist-info support.
pip's wheel support requires setuptools >= 0.8 for dist-info support.

我不理解这条消息(I have setuptools 2.1)或该怎么办。


此错误的日志中的异常信息:

Exception information:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 230, in run
    finder = self._build_package_finder(options, index_urls, session)
  File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 185, in _build_package_finder
    session=session,
  File "/Library/Python/2.7/site-packages/pip/index.py", line 50, in __init__
    self.use_wheel = use_wheel
  File "/Library/Python/2.7/site-packages/pip/index.py", line 89, in use_wheel
    raise InstallationError("pip's wheel support requires setuptools >= 0.8 for dist-info support.")
InstallationError: pip's wheel support requires setuptools >= 0.8 for dist-info support.

2 个答案:

答案 0 :(得分:147)

这对我有用:

sudo pip install setuptools --no-use-wheel --upgrade

注意它是sudo的用法

<强>更新

在窗口中,您只需要以管理员身份执行pip install setuptools --no-use-wheel --upgrade。在unix / linux中,sudo命令用于提升权限。

<强>更新

这似乎已在1.5.1中修复。

答案 1 :(得分:10)

首先,你永远不应该运行'sudo pip'。

如果可能,您应该使用系统软件包管理器,因为它使用GPG签名来确保您没有运行恶意代码。

否则,请尝试升级setuptools:

easy_install -U setuptools

或者,尝试:

pip install --user <somepackage>

这当然是“全球”套餐。你最好使用virtualenvs。