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

3

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.
Foundling answered 3/1, 2014 at 14:0 Comment(0)
K
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.

Khufu answered 3/1, 2014 at 14:56 Comment(10)
Sorry that doesn't seem to completely solve my problem, still working on it.Khufu
I had to revert using pip 1.4 for now, will look for a fix later.Khufu
Worked for me. No idea why this happened.Vindicable
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.Foundling
Worked for me on Centos 6. Talk about an abstract error message.Dapsang
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)Marven
Worked for me in Raspbian! :)Oys
Oh! I just need to execute as administrator on windows. pip install setuptools --no-use-wheel --upgradeV2
@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.Foundling
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.V2
N
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.

Newhall answered 10/1, 2014 at 15:15 Comment(3)
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.Bally
@LukeSneeringer: Why is it "wrong". I don't think I really have a choice, without some major reconfiguration.Foundling
easy_install -U setuptools rocks!Guipure
H
0

As a contribute to debugging efforts, I got the "AssertionError: Multiple .egg-info directories found error: subprocess-exited-with-errors" on windows python 3.11. It seems related to setuptools.

I was cleaning the c:\users<user>\appdata\local\temp but error persisted. Did not find any file/folder name matching ".egg-info" (while there are files matching "egg_info"

possibly unusual fact is that the package I am building is in drive F: while virtual env is on drive C: Paths are otherwise fine.

(venv_mfa) PS F:\pj_tpl> python -m pip install --no-cache-dir -v -e .
Using pip 23.1.2 from C:\Users\mgua0\venv_mfa\Lib\site-packages\pip (python 3.11)
Obtaining file:///F:/pj_tpl
  Running command pip subprocess to install build dependencies
  Collecting setuptools
    Using cached setuptools-67.8.0-py3-none-any.whl (1.1 MB)
  Installing collected packages: setuptools
  Successfully installed setuptools-67.8.0
  Installing build dependencies ... done
  Running command Checking if build backend supports build_editable
  Checking if build backend supports build_editable ... done
  Running command Getting requirements to build editable
  Getting requirements to build editable ... done
  Running command pip subprocess to install backend dependencies
  Collecting wheel
    Using cached wheel-0.40.0-py3-none-any.whl (64 kB)
  Installing collected packages: wheel
  Successfully installed wheel-0.40.0
  Installing backend dependencies ... done
  Running command Preparing editable metadata (pyproject.toml)
  Traceback (most recent call last):
    File "C:\Users\mgua0\venv_mfa\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in 
      main()
    File "C:\Users\mgua0\venv_mfa\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\mgua0\venv_mfa\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 181, in prepare_metadata_for_build_editable
      return hook(metadata_directory, config_settings)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\mgua0\AppData\Local\Temp\pip-build-env-swirme89\overlay\Lib\site-packages\setuptools\build_meta.py", line 454, in prepare_metadata_for_build_editable
      return self.prepare_metadata_for_build_wheel(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\mgua0\AppData\Local\Temp\pip-build-env-swirme89\overlay\Lib\site-packages\setuptools\build_meta.py", line 382, in prepare_metadata_for_build_wheel
      self._bubble_up_info_directory(metadata_directory, ".egg-info")
    File "C:\Users\mgua0\AppData\Local\Temp\pip-build-env-swirme89\overlay\Lib\site-packages\setuptools\build_meta.py", line 353, in _bubble_up_info_directory
      info_dir = self._find_info_directory(metadata_directory, suffix)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\mgua0\AppData\Local\Temp\pip-build-env-swirme89\overlay\Lib\site-packages\setuptools\build_meta.py", line 364, in _find_info_directory
      assert len(candidates) == 1, f"Multiple {suffix} directories found"
             ^^^^^^^^^^^^^^^^^^^^
  AssertionError: Multiple .egg-info directories found
  error: subprocess-exited-with-error

  × Preparing editable metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: 'C:\Users\mgua0\venv_mfa\Scripts\python.exe' 'C:\Users\mgua0\venv_mfa\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py' prepare_metadata_for_build_editable 'C:\Users\mgua0\AppData\Local\Temp\tmpxmnvgja0'
  cwd: F:\pj_tpl
  Preparing editable metadata (pyproject.toml) ... error
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
(venv_mfa) PS F:\pj_tpl>
Haldis answered 28/5, 2023 at 21:24 Comment(1)
If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From ReviewAlmeda

© 2022 - 2024 — McMap. All rights reserved.