Python Forum
how to get pip to uninstall packages - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Forum & Off Topic (https://python-forum.io/Forum-Forum-Off-Topic)
+--- Forum: Bar (https://python-forum.io/Forum-Bar)
+--- Thread: how to get pip to uninstall packages (/Thread-how-to-get-pip-to-uninstall-packages)



how to get pip to uninstall packages - Skaperen - Aug-26-2018

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)?


RE: how to get pip to uninstall packages - Axel_Erfurt - Aug-27-2018

You did not write which package you want uninstall (pip or apturl or ?)


RE: how to get pip to uninstall packages - Gribouillis - Aug-27-2018

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.


RE: how to get pip to uninstall packages - Skaperen - Aug-27-2018

(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.


RE: how to get pip to uninstall packages - Axel_Erfurt - Aug-28-2018

(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



RE: how to get pip to uninstall packages - Skaperen - Aug-29-2018

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?


RE: how to get pip to uninstall packages - madhuweblogic11 - Nov-01-2018

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


RE: how to get pip to uninstall packages - Skaperen - Nov-01-2018

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.