Latest 'pip' fails with "requires setuptools >= 0.8 for dist-info"

33,547

Solution 1

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.

Solution 2

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.

Share:
33,547

Related videos on Youtube

orome
Author by

orome

"I mingle the probable with the necessary and draw a plausible conclusion from the mixture."

Updated on July 05, 2022

Comments

  • orome
    orome almost 2 years

    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.
    
  • Rolandf
    Rolandf over 10 years
    Sorry that doesn't seem to completely solve my problem, still working on it.
  • Rolandf
    Rolandf over 10 years
    I had to revert using pip 1.4 for now, will look for a fix later.
  • amoe
    amoe over 10 years
    Worked for me. No idea why this happened.
  • orome
    orome over 10 years
    Note that the added --no-use-wheel option simply skips use of 'wheel archives', but otherwise preforms exactly the same install as a command that omits it.
  • fred
    fred over 10 years
    Worked for me on Centos 6. Talk about an abstract error message.
  • mafrosis
    mafrosis over 10 years
    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)
  • SuperIRis
    SuperIRis over 10 years
    Worked for me in Raspbian! :)
  • IsmailS
    IsmailS over 10 years
    Oh! I just need to execute as administrator on windows. pip install setuptools --no-use-wheel --upgrade
  • orome
    orome over 10 years
    @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.
  • Luke Sneeringer
    Luke Sneeringer over 10 years
    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.
  • orome
    orome over 10 years
    @LukeSneeringer: Why is it "wrong". I don't think I really have a choice, without some major reconfiguration.
  • IsmailS
    IsmailS over 10 years
    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.
  • madzohan
    madzohan over 7 years
    easy_install -U setuptools rocks!