Requirement already satisfied by egg but package not installed

See original GitHub issue
  • Pip version: 8.1.2
  • Python version: 3.5.1
  • Operating System: OS X 10.11.5

Description:

In this example, I’m using setuptools because that’s the package I was developing, but the issue could be replicated with any package.

I’d just finished developing setuptools and wanted to install a final version, so I did python setup.py develop --uninstall. Now I have no setuptools installed, so I want to use pip to install it, but when I attempt to do so, it fails to install, saying the requirement is already satisfied. However, the egg it references about being already satisfied isn’t actually on sys.path, so it’s not installed (and thus not satisfied for install).

It seems that the presence of an egg from a previous install of setuptools is blocking the installation of any version.

As I’m working toward getting away from using easy_install and relying more on pip, I wanted to use pip to install setuptools rather than use the bootstrap script or install from source.

I would expect pip to be able to install the requested in this case, even if it has to uninstall extant eggs or just add them to the easy-install.pth file to make them installed.

I have found that if I repeatedly run pip unistall -y setuptools until it no longer finds any versions, I can then install setuptools.

What I’ve run:

$ python -m pip install setuptools
Requirement already satisfied (use --upgrade to upgrade): setuptools in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/setuptools-21.0.0-py3.5.egg
$ python -c "import setuptools"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named 'setuptools'
$ pip freeze | grep setuptools
$ pip uninstall -y setuptools
...
$ pip uninstall -y setuptools
...
$ pip uninstall -y setuptools
...
$ python -m pip uninstall -y setuptools
Cannot uninstall requirement setuptools, not installed
$ python -m pip install --egg setuptools
Collecting setuptools
  Using cached setuptools-21.1.0-py2.py3-none-any.whl
Installing collected packages: setuptools
Successfully installed setuptools-21.1.0

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:17 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
nishnikcommented, Nov 13, 2016

For people struggling with hack to get it right, I had similar issue:

nishnik@nishnik-Lenovo-Y50-70:~$ pip uninstall selenium
Cannot uninstall requirement selenium, not installed
nishnik@nishnik-Lenovo-Y50-70:~$ sudo pip3 install selenium --user
Requirement already satisfied (use --upgrade to upgrade): selenium in /usr/local/lib/python3.5/dist-packages

I deleted the directory /usr/local/lib/python3.5/dist-packages/selenium and then pip installed it again, it worked right for me.

0reactions
sbidoulcommented, Apr 5, 2020

This should be resolved by #7955.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python module not found even though "Requirement Already ...
Run in command prompt. pip list. Check what version you have installed on your system if you have an old version.
Read more >
User Guide - pip documentation v22.3.1
In older versions of pip, it is possible for pip to install a package which does not satisfy the declared requirements of another...
Read more >
12288 (Replace easy_install and eggs with pip and wheels)
It looks like easy_install is still required when you decide to run trac on its standalone webserver on Windows (with SRVANY). In fact,...
Read more >
Installing Packages : TechWeb - Boston University
While we try to satisfy all requests for specific Python packages, we may not be able to meet your needs ... We recommend...
Read more >
Installing Python package with .egg ?, works in IDLE but not ...
I have installed dorna Python package . ... C:\Users\cod18>python -m pip install Dorna Requirement already satisfied: Dorna in ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found