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:
- Created 7 years ago
- Comments:17 (15 by maintainers)
Top Related StackOverflow Question
For people struggling with hack to get it right, I had similar issue:
I deleted the directory
/usr/local/lib/python3.5/dist-packages/seleniumand then pip installed it again, it worked right for me.This should be resolved by #7955.