Python Forum
how to get pip to uninstall packages
Thread Rating:
  • 2 Vote(s) - 2.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to get pip to uninstall packages
#1
i am getting errors like these:
Output:
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. Cannot uninstall 'bottle'. 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. Cannot uninstall 'Brlapi'. 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. Cannot uninstall 'command-not-found'. 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. Cannot uninstall 'docutils'. 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. Cannot uninstall 'fail2ban'. 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. Cannot uninstall 'louis'. 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. Cannot uninstall 'onboard'. 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.
there are many more when i feed its list of packages to pip uninstall commands.

and when i install Ubuntu package python3-pip then do pip3 install --upgrade pip it acts like this:
Output:
Collecting pip Using cached https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl Installing collected packages: pip Found existing installation: pip 8.1.1 Not uninstalling pip at /usr/lib/python3/dist-packages, outside environment /usr Successfully installed pip-18.0
apparently it leaves both versions installed.

does anyone have the direct path to the tarball (not a page with a link as that seems to not show up, right)?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
You did not write which package you want uninstall (pip or apturl or ?)
Reply
#3
You could perhaps sudo pip3 install --upgrade pip ? Also why do you want to uninstall these packages? You won't save much disk space by removing them.
Reply
#4
(Aug-27-2018, 07:14 AM)Axel_Erfurt Wrote: You did not write which package you want uninstall (pip or apturl or ?)

i have a script made from the list of packages, except pip itself, to uninstall them all.

(Aug-27-2018, 07:38 AM)Gribouillis Wrote: You could perhaps sudo pip3 install --upgrade pip ? Also why do you want to uninstall these packages? You won't save much disk space by removing them.

i am running the script mentioned above from a root shell. i have upgraded pip itself and it replaced pip3 with just pip. i plan to then manually uninstall pip, make a list of what remains in /usr, then install things back (ubuntu packages and pypi packages) making a list of /usr between each install, then test to see what works.

(Aug-27-2018, 07:38 AM)Gribouillis Wrote: You could perhaps sudo pip3 install --upgrade pip ? Also why do you want to uninstall these packages? You won't save much disk space by removing them.

the reason is to have an initial state with no packages installed.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#5
(Aug-27-2018, 10:46 PM)Skaperen Wrote: i have a script made from the list of packages, except pip itself, to uninstall them all.

something like this?

Quote:pip freeze > requirements.txt
pip uninstall -r requirements.txt -y
Reply
#6
no, not like that. i don't understand that. the script i made had a pip uninstall for each package name taken from the first field of the output of pip list. is there any particular meaning to the file name of requirements.txt?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#7
Hi Team,

We couldnot able to uninstall Django package, We are getting below error. Please let us know how to resolve this issue

# pip uninstall django
Cannot uninstall 'Django'. 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.

Thanks,
Madhu
Reply
#8
although packages in pypi tend to be more up to date than other repositories, the packaging system they use seems to be a poor design.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Can't uninstall PyCharm Exsul 1 5,507 Mar-29-2019, 02:22 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020