How to uninstall a package installed with pip install --user

Serjik

There is a --user option for pip which can install a Python package per user:

pip install --user [python-package-name]

I used this option to install a package on a server for which I do not have root access. What I need now is to uninstall the installed package on the current user. I tried to execute this command:

pip uninstall --user [python-package-name]

But I got:

no such option: --user

How can I uninstall a package that I installed with pip install --user, other than manually finding and deleting the package?

I've found this article

pip cannot uninstall from per-user site-packages directory

which describes that uninstalling packages from user directory does not supported. According to the article if it was implemented correctly then with

pip uninstall [package-name]

the package that was installed will be also searched in user directories. But a problem still remains for me. What if the same package was installed both system-wide and per-user? What if someone needs to target a specific user directory?

Thomas Lotze

Having tested this using Python 3.5 and pip 7.1.2 on Linux, the situation appears to be this:

  • pip install --user somepackage installs to $HOME/.local, and uninstalling it does work using pip uninstall somepackage.

  • This is true whether or not somepackage is also installed system-wide at the same time.

  • If the package is installed at both places, only the local one will be uninstalled. To uninstall the package system-wide using pip, first uninstall it locally, then run the same uninstall command again, with root privileges.

  • In addition to the predefined user install directory, pip install --target somedir somepackage will install the package into somedir. There is no way to uninstall a package from such a place using pip. (But there is a somewhat old unmerged pull request on Github that implements pip uninstall --target.)

  • Since the only places pip will ever uninstall from are system-wide and predefined user-local, you need to run pip uninstall as the respective user to uninstall from a given user's local install directory.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

is there an uninstall equivalent to "pip install --user <package>"?

From Dev

How to fully uninstall pip installed with easy_install?

From Java

pip cannot uninstall <package>: "It is a distutils installed project"

From Dev

pip cannot uninstall <package>: "It is a distutils installed project"

From Dev

Unable to uninstall package installed by easy_install

From Dev

How to install pip and a python package for self installed python?

From Dev

How to install pip and a python package for self installed python?

From Java

How to uninstall editable packages with pip (installed with -e)

From Dev

My package installed with pip install shows no modules

From Dev

How to uninstall a Haskell package installed with stack?

From Dev

How to uninstall a package of which two versions are installed?

From Dev

How to uninstall virtualbox package: "is not installed, so not removed"

From Dev

How to make 'pip install' not uninstall other versions?

From Dev

Uninstall a Package Installed With Curl

From Dev

How to see pip package sizes installed?

From Dev

How to update a Python package which was installed by pip

From Dev

How to remove a pip package installed with sudo -h

From Java

How do I uninstall a package installed using npm link?

From Dev

How to uninstall a python package that I installed after compiling it with bazel?

From Dev

Uninstall package locally installed with checkinstall

From Dev

Package installed with pip is not found

From Dev

can't uninstall package with pip

From Dev

How to uninstall a program installed by another user that is not accessible anymore?

From Dev

How to uninstall an application installed in the user profile without administrator?

From Dev

How to remove/install a package that is not fully installed?

From Dev

How to remove/install a package that is not fully installed?

From Dev

How to `pip install` a package that has Git dependencies?

From Dev

How to install a specific version of a package with pip

From Dev

How to install a pip package locally in Dockerfile?

Related Related

  1. 1

    is there an uninstall equivalent to "pip install --user <package>"?

  2. 2

    How to fully uninstall pip installed with easy_install?

  3. 3

    pip cannot uninstall <package>: "It is a distutils installed project"

  4. 4

    pip cannot uninstall <package>: "It is a distutils installed project"

  5. 5

    Unable to uninstall package installed by easy_install

  6. 6

    How to install pip and a python package for self installed python?

  7. 7

    How to install pip and a python package for self installed python?

  8. 8

    How to uninstall editable packages with pip (installed with -e)

  9. 9

    My package installed with pip install shows no modules

  10. 10

    How to uninstall a Haskell package installed with stack?

  11. 11

    How to uninstall a package of which two versions are installed?

  12. 12

    How to uninstall virtualbox package: "is not installed, so not removed"

  13. 13

    How to make 'pip install' not uninstall other versions?

  14. 14

    Uninstall a Package Installed With Curl

  15. 15

    How to see pip package sizes installed?

  16. 16

    How to update a Python package which was installed by pip

  17. 17

    How to remove a pip package installed with sudo -h

  18. 18

    How do I uninstall a package installed using npm link?

  19. 19

    How to uninstall a python package that I installed after compiling it with bazel?

  20. 20

    Uninstall package locally installed with checkinstall

  21. 21

    Package installed with pip is not found

  22. 22

    can't uninstall package with pip

  23. 23

    How to uninstall a program installed by another user that is not accessible anymore?

  24. 24

    How to uninstall an application installed in the user profile without administrator?

  25. 25

    How to remove/install a package that is not fully installed?

  26. 26

    How to remove/install a package that is not fully installed?

  27. 27

    How to `pip install` a package that has Git dependencies?

  28. 28

    How to install a specific version of a package with pip

  29. 29

    How to install a pip package locally in Dockerfile?

HotTag

Archive