Wednesday, May 1, 2024
 Popular · Latest · Hot · Upcoming
60
rated 0 times [  60] [ 0]  / answers: 1 / hits: 342388  / 2 Years ago, fri, march 4, 2022, 12:51:17

I have accidently installed Python packages to my system using pip instead of apt-get. I did this in two ways:




  • using an older version of virtualenv, I forgot to append --no-site-packages when creating the virtualenv - after that when I called pip install, the Python packages where installed to the system rather than the virtualenv

  • in a correctly setup virtualenv, I typed sudo pip install somepackage - the sudo installed to the system rather than the virtualenv



I happened to notice this because I typed pip freeze outside a virtualenv, and spotted some Python packages listed that shouldn't be there. So now my question is:




  • how do I identify all Python packages that have been erroneously installed on the system (that is, Python packages that appear in the pip freeze list, but were not installed with apt-get)?

  • how do I remove them?


More From » python

 Answers
1

Ubuntu Oneiric (and I expect newer versions too) install pip packages to /usr/local/lib/python2.7/dist-packages, and apt packages to /usr/lib/python2.7/dist-packages. So just check the former directory and sudo pip uninstall every package you find there.


[#36302] Saturday, March 5, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
impisaso

Total Points: 423
Total Questions: 106
Total Answers: 104

Location: Virgin Islands (U.S.)
Member since Tue, Feb 2, 2021
3 Years ago
;