Home Computer Tutorials Computer Knowledge PIP Uninstall All Python Packages in Windows, Learn Essentials

PIP Uninstall All Python Packages in Windows, Learn Essentials

Apr 24, 2025 am 12:07 AM

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.

PIP Uninstall All Python Packages in Windows, Learn Essentials

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:

  1. Press Win R , enter sysdm.cpl and click OK to open system properties.
  2. Go to Advanced > Environment Variables .
  3. Under User Variables , click New to edit the variable name and variable value .
  4. 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:

  1. Open the Windows command prompt as an administrator.
  2. Enter cd\ in the CMD window and press Enter .
  3. Enter cd followed by the Python script path, for example: cd C:\Users\cy\AppData\Local\Programs\Python\Python311\Scripts . Then press Enter .
  4. 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 .

PIP Uninstall All Python Packages in Windows, Learn Essentials

  1. 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 the requirements.txt file.
  • pip uninstall -r requirements.txt : Uninstall the packages listed in the requirements.txt file one by one.
  • pip uninstall -r requirements.txt -y : Uninstall all packages listed in the requirements.txt file at once.
  • pip freeze | xargs pip uninstall -y : Use the xargs 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!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to Fix the Steam Cloud Error? Try These Methods How to Fix the Steam Cloud Error? Try These Methods Apr 04, 2025 am 01:51 AM

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.

Windows Metadata and Internet Services Problem: How to Fix It? Windows Metadata and Internet Services Problem: How to Fix It? Apr 02, 2025 pm 03:57 PM

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.

How to Resolve the KB5035942 Update Issues – Crashing System How to Resolve the KB5035942 Update Issues – Crashing System Apr 02, 2025 pm 04:16 PM

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

Remove PC App Store Malware - A Full Guide for You! Remove PC App Store Malware - A Full Guide for You! Apr 04, 2025 am 01:41 AM

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.

Fixed – OneDrive Not Uploading Photos on PC Fixed – OneDrive Not Uploading Photos on PC Apr 02, 2025 pm 04:04 PM

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!

Fix: Brothers: A Tale of Two Sons Remake Not Launching/Loading Fix: Brothers: A Tale of Two Sons Remake Not Launching/Loading Apr 02, 2025 am 02:40 AM

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.

How to Use Chris Titus Tool to Create a Debloated Win11/10 ISO How to Use Chris Titus Tool to Create a Debloated Win11/10 ISO Apr 01, 2025 am 03:15 AM

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.

MSConfig Keeps Reverting to Selective Startup? 2 Solutions Here MSConfig Keeps Reverting to Selective Startup? 2 Solutions Here Mar 28, 2025 pm 12:06 PM

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.

See all articles