question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pip install does not remove previous egg/dist info.

See original GitHub issue

Let 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:closed
  • Created 8 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
piotr-dobrogostcommented, Oct 4, 2015

Just wanted to add that it seems like pip also does not delete .dist-info directory when uninstalling package installed in editable mode.

0reactions
dstufftcommented, Mar 22, 2017

Closing this, I can’t reproduce this. If you’re still having issues please open a new issue with reproduction steps.

Read more comments on GitHub >

github_iconTop 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 >

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