Reputation: 183
I'm very newbie to python, when I was installing packages through pip3, I messed up with "sudo pip3" and "pip3" (I didn't know the difference that time). Recently I want to remove all the packages installed before, I have tried
pip3 freeze > rquirements.txt
pip3 uninstall -r requirements.txt -y
and I get
Cannot uninstall 'apturl'. It is a distutils installed project and
thus we cannot accurately determine which files belong to it which
would lead to only a partial uninstall
than I tried to add sudo with -H flag
sudo -H pip3 uninstall -r requirements.txt -y
this time I get lots of packages not uninstalled
Not uninstalling apturl at /usr/lib/python3/dist-packages, outside environment /usr
Not uninstalling asn1crypto at /usr/lib/python3/dist-packages, outside environment /usr
Not uninstalling brlapi at /usr/lib/python3/dist-packages, outside environment /usr
Not uninstalling certifi at /usr/lib/python3/dist-packages, outside environment /usr
Not uninstalling chardet at /usr/lib/python3/dist-packages, outside environment /usr
Not uninstalling command-not-found at /usr/lib/python3/dist-packages, outside environment /usr
.
.
.
I have no idea what happened, need some help
Upvotes: 2
Views: 2763
Reputation: 795
The packages that are in distutils won't uninstall if you are using pip v10 or higher for the rest of the packages that you installed via pip can be uninstalled using
pip freeze | xargs pip uninstall -y
pip3 freeze | xargs pip3 uninstall -y
Upvotes: 2