83

Using the recent (1.5) version of pip, I get an error when attempting to update several packages. For example, sudo pip install -U pytz results in failure with:

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

I don't understand this message (I have setuptools 2.1) or what to do about it.


Exception information from the log for this error:

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.
Community
  • 1
  • 1
orome
  • 40,124
  • 45
  • 174
  • 373

2 Answers2

148

This worked for me:

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

Note it's usage of sudo

UPDATE

On Windows you just need to execute pip install setuptools --no-use-wheel --upgrade as an administrator. In Unix/Linux, the sudo command is for elevating permissions.

UPDATE 2

This appears to have been fixed in 1.5.1.

Josh Correia
  • 2,801
  • 2
  • 24
  • 37
Rolandf
  • 1,639
  • 1
  • 11
  • 10
  • Sorry that doesn't seem to completely solve my problem, still working on it. – Rolandf Jan 03 '14 at 15:20
  • I had to revert using pip 1.4 for now, will look for a fix later. – Rolandf Jan 03 '14 at 15:44
  • Worked for me. No idea why this happened. – amoe Jan 03 '14 at 16:06
  • 4
    Note that the added `--no-use-wheel` option simply skips use of ['wheel archives'](http://wheel.readthedocs.org/en/latest/#wheel), but otherwise preforms exactly the same install as a command that omits it. – orome Jan 05 '14 at 03:45
  • 1
    Worked for me on Centos 6. Talk about an abstract error message. – fred Jan 05 '14 at 15:16
  • I would like to add that from within my virtualenv, the use of sudo caused this to not work. Dropping the sudo meant it ran with my newly install pip v1.5 (which has the --no-use-wheel flag) – mafrosis Jan 07 '14 at 00:10
  • Worked for me in Raspbian! :) – SuperIRis Jan 07 '14 at 01:41
  • Oh! I just need to execute as administrator on windows. `pip install setuptools --no-use-wheel --upgrade` – IsmailS Jan 08 '14 at 06:03
  • @iSid: Yes, that's the trick. All the extra `--no-use-wheel` flag does is skip archives. The process works, and will do exactly what it would otherwise do, so no worries. It should work on any platform. – orome Jan 09 '14 at 23:38
  • yeah! I asked that because, there is no sudo command in windows and I didn't knew that it is just to elevate the permissions. – IsmailS Jan 12 '14 at 06:34
11

First, you should never run 'sudo pip'.

If possible you should use your system package manager because it uses GPG signatures to ensure you're not running malicious code.

Otherwise, try upgrading setuptools:

easy_install -U setuptools

Alternatively, try:

pip install --user <somepackage>

This is of course for "global" packages. You should ideally be using virtualenvs.

user1503941
  • 436
  • 3
  • 8
  • 6
    Generally, running pip as sudo is the wrong thing. However, sometimes you *do* need to install things into system python (such as virtualenv, or pip itself), and sudo is appropriate then. – Luke Sneeringer Jan 10 '14 at 21:17
  • 1
    @LukeSneeringer: [Why is it "wrong".](http://stackoverflow.com/q/21055859/656912) I don't think I really have a choice, without some major reconfiguration. – orome Jan 10 '14 at 22:46
  • 1
    `easy_install -U setuptools` rocks! – madzohan Sep 16 '16 at 08:44