What Is PIP?
Before introducing something on how to uninstall PIP packages, let’s first see a general introduction to Python PIP.
PIP is a package manager in Python that is used to install and manage Python packages. This tool allows you to install and manage Python applications and their dependencies. Package management is very important, so PIP is pre-installed in most Python distributions. By default, Python 3.4 and later & Python 2.7.9 and later (on the Python2 series) include PIP.
If you install a Python package, due to some reason, you may want to uninstall it. Well then, how to uninstall Python package with PIP? Follow the guide here now to know some details.
MiniTool System Booster TrialClick to Download100%Clean & Safe
PIP Uninstall Package – How to Do in Windows
In this part, we show you some commands to uninstall PIP packages, and let’s see them one by one.
PIP Uninstall Packagename
Using this command, you can remove the installed package one by one. This method only works when you have already added Python to the Windows path. If you don’t know how to add it, you can go to press Win + R, type sysdm.cpl and click OK to open System Properties. Go to Advanced > Environment Variables. Under User variables, click New, and edit Variable name and Variable value.
In terms of Variable value, it should include the Python application path and Python Scripts path. To find them, right-click on your Python app (which can be found via the Windows search bar) and choose Open file location. Then, right-click on the Python shortcut and choose Open file location. The app path can be seen like C:\Users\cy\AppData\Local\Programs\Python\Python311. The Scripts path should be C:\Users\cy\AppData\Local\Programs\Python\Python311\Scripts.
Next, see how to uninstall PIP.
Step 1: In Windows, open Command Prompt with admin rights.
Step 2: Type cd\ into the CMD window and press Enter.
Step 3: Type cd followed by the Python Scripts path and here is an example – cd C:\Users\cy\AppData\Local\Programs\Python\Python311\Scripts. Then, press Enter.
Step 4: Execute this command – pip uninstall package_name. Replace the package name with the one you have installed like pandas. See an example pip uninstall pandas.
Step 5: Type y to confirm the uninstallation when asked. Now, your Python package is removed from your computer.
PIP Uninstall All Packages
If you want to delete all the packages installed by PIP, you can use the pip freeze command. It can help you list all the installed packages via PIP and uninstall them without asking for confirmation. The correct type of this command is pip uninstall -y -r <(pip freeze).
If you want, you can save the installed packages in a file called requirements.txt and directly uninstall PIP packages from the file. Run these commands:
pip freeze > requirements.txt
pip uninstall -r requirements.txt This helps to uninstall packages one by one.
pip uninstall -r requirements.txt -y This helps to delete all the packages at once.
In addition to pip freeze, you can also use xargs to uninstall all the PIP packages. The command is pip freeze | xargs pip uninstall -y. If you have packages installed via VCS (like GitLab, Github, Bitbucket, etc.), you need to exclude them and then uninstall Python packages with PIP via this command – pip freeze | grep -v “^-e” | xargs pip uninstall -y.
Final Words
How to uninstall Python package with PIP or how to uninstall PIP packages? After reading this guide on PIP uninstall, try the given ways to easily remove packages from your Windows computer if you need. If you have any ideas, let us know in the comment part.