pip install does not remove previous egg/dist info.
See original GitHub issueLet me describe this. make a virtualenv
# virtualenv venv
# source venv/bin/activated
# pip list
pip (1.5.6)
setuptools (3.6)
wsgiref (0.1.2)
install a package
# pip install jinja2==2.7.3
# pip list
Jinja2 (2.7.3)
MarkupSafe (0.23)
pip (1.5.6)
setuptools (3.6)
wsgiref (0.1.2)
install another version
# pip install jinja2==2.7.1
# pip list
Jinja2 (2.7.1)
MarkupSafe (0.23)
pip (1.5.6)
setuptools (3.6)
wsgiref (0.1.2)
it’s ok till now. but there exists two egg info.
# ls venv/lib/python2.7/site-packages/Jinja2-*
venv/lib/python2.7/site-packages/Jinja2-2.7.1-py2.7.egg-info
venv/lib/python2.7/site-packages/Jinja2-2.7.3-py2.7.egg-info
try install another version
# pip install jinja2==2.8
# pip list
Jinja2 (2.7.1)
MarkupSafe (0.23)
pip (1.5.6)
setuptools (3.6)
wsgiref (0.1.2)
something is wrong, we expect version 2.8, but it’s 2.7.1 here. check the egg/dist info:
# ls venv/lib/python2.7/site-packages/Jinja2-*
venv/lib/python2.7/site-packages/Jinja2-2.7.1-py2.7.egg-info
venv/lib/python2.7/site-packages/Jinja2-2.7.3-py2.7.egg-info
venv/lib/python2.7/site-packages/Jinja2-2.8.dist-info
it seems pip get the least version from these egg/dist infos. the I upgrade setuptools:
# pip install --upgrade setuptools
# pip list
Jinja2 (2.7.1)
MarkupSafe (0.23)
pip (1.5.6)
setuptools (18.3.1)
it seems ok. but there still exists two version dist infos.
# ls venv/lib/python2.7/site-packages/setuptools-*
venv/lib/python2.7/site-packages/setuptools-18.3.1.dist-info
venv/lib/python2.7/site-packages/setuptools-3.6.dist-info
actually, I found that pip use the first found(least version sort just by dict order) egg/dist info’s version for displaying.
pip should remove previous(others except current installed one) egg/dist infos or change a way to get the current package version or there is some options I don’t know.
It makes me mad!!
Issue Analytics
- State:
- Created 8 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
python - pip: Why sometimes installed as egg ... - Stack Overflow
It won't remove other versions because what is installed now is only a installation dependency. You can remove those again after installation ...
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 >Using Python's pip to Manage Your Projects' Dependencies
Fix common errors related to working with pip; Install and uninstall packages with pip; Manage projects' dependencies using requirements files.
Read more >How to Uninstall Python Packages - ActiveState
When you install a package with pip, it also installs all of the dependencies the package requires. Unfortunately, pip does not uninstall ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Just wanted to add that it seems like pip also does not delete .dist-info directory when uninstalling package installed in editable mode.
Closing this, I can’t reproduce this. If you’re still having issues please open a new issue with reproduction steps.