


PIP Uninstall All Python Packages in Windows, Learn Essentials
PIP guide to uninstalling Python packages: thoroughly clear unwanted packages
This article will guide you on how to uninstall Python packages using PIP. PIP is a package manager for Python that installs and manages Python packages and their dependencies. Most Python distributions have PIP pre-installed. If you want to uninstall installed Python packages, please continue reading.
Uninstall a single Python package
This method is only valid if Python has been added to the Windows environment variable path. If you have not added it yet, follow these steps:
- Press Win R , enter sysdm.cpl and click OK to open system properties.
- Go to Advanced > Environment Variables .
- Under User Variables , click New to edit the variable name and variable value .
- Variable value should contain the Python application path and the Python script path. To find them, right-click on your Python application (which can be found through the Windows search bar) and select the location to open the file . Then, right-click on the Python shortcut and select Open file location . The application path may be similar to C:\Users\cy\AppData\Local\Programs\Python\Python311 . The script path should be C:\Users\cy\AppData\Local\Programs\Python\Python311\Scripts .
Next, follow the steps below to uninstall the PIP package:
- Open the Windows command prompt as an administrator.
- Enter cd\ in the CMD window and press Enter .
- Enter cd followed by the Python script path, for example: cd C:\Users\cy\AppData\Local\Programs\Python\Python311\Scripts . Then press Enter .
- Execute the command: pip uninstall package name . Replace the package name with the name of the package you want to uninstall, for example: pip uninstall pandas .
- When asked, enter y to confirm uninstallation. Your Python package has now been removed from your computer.
Uninstall all Python packages
To delete all packages installed by PIP, you can use the following command:
-
pip freeze > requirements.txt
: List all installed packages into therequirements.txt
file. -
pip uninstall -r requirements.txt
: Uninstall the packages listed in therequirements.txt
file one by one. -
pip uninstall -r requirements.txt -y
: Uninstall all packages listed in therequirements.txt
file at once. -
pip freeze | xargs pip uninstall -y
: Use thexargs
command to uninstall all packages at once. -
pip freeze | grep -v “^-e” | xargs pip uninstall -y
: Uninstall all other packages at once after excluding packages installed through version control system (VCS).
Summarize
This article describes a variety of ways to uninstall a single or all Python packages using PIP. Choose the right method according to your needs and easily manage your Python environment. If you have any questions or suggestions, please leave a message in the comment section.
The above is the detailed content of PIP Uninstall All Python Packages in Windows, Learn Essentials. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The Steam Cloud error can be caused by many reasons. To play a game smoothly, you need to take some measures to remove this error before you launch the game. php.cn Software introduces some best ways as well as more useful information in this post.

You may see the “A connection to the Windows Metadata and Internet Services (WMIS) could not be established.” error on Event Viewer. This post from php.cn introduces how to remove the Windows Metadata and Internet Services problem.

KB5035942 update issues - crashing system commonly happens to users. Inflicted people hope to find a way out of the kind of trouble, such as crashing system, installation, or sound issues. Targeting these situations, this post published by php.cn wil

If you have a program called PC App Store on your computer and did not purposely install it, then your PC may be infected with the malware. This post from php.cn introduces how to remove PC App Store malware.

OneDrive is an online cloud storage service from Microsoft. At times, you might find OneDrive fail to upload photos to the cloud. If you are on the same boat, keep reading this post from php.cn Software to get effective solutions now!

Is Brothers: A Tale of Two Sons Remake not launching? Encountering Brothers: A Tale of Two Sons Remake black screen? Here this post on php.cn offers you tested solutions to assist you in addressing this problem.

Chris Titus Tech has a tool called Windows Utility that can help you easily create a debloated Windows 11/10 ISO to install a clean system. php.cn offers a full guide on how to do this thing using the Chris Titus tool.

Are you questioned about an issue that MSConfig keeps reverting to selective startup on your Windows? How to switch to normal startup if you require it? Try the methods explained in this php.cn post to find one that works for you.
