close

How to uninstall a package installed with pip install –user

Hello Guys, How are you all? Hope You all Are Fine. Today We Are Going To learn about How to uninstall a package installed with pip install –user in Python. So Here I am Explain to you all the possible Methods here.

Without wasting your time, Let’s start This Article.

Table of Contents

How to uninstall a package installed with pip install –user?

  1. How to uninstall a package installed with pip install –user?

    example to uninstall package 'oauth2client' on MacOS:
    pip uninstall oauth2client

  2. uninstall a package installed with pip install –user

    example to uninstall package 'oauth2client' on MacOS:
    pip uninstall oauth2client

Method 1

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.

Method 2

example to uninstall package ‘oauth2client’ on MacOS:

pip uninstall oauth2client

Conclusion

It’s all About this issue. Hope all Methods helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which Method worked for you? Thank You.

Also, Read