How to delete an installed module in Python? (2024)

PythonServer Side ProgrammingProgramming

You can uninstall a Python package on Windows by opening the Windows Command Prompt and entering the following command −

pip uninstall module_name

Uninstalling a package using pip

Python's package manager is called PIP. In other words, it is a tool that enables us to install Python packages and dependencies (the software elements needed by your code to function without throwing any errors) that are not already available to us through the Python Standard Library.

A computer language's tool that makes it simple to install any external dependencies is known as a package manager. Any package can be installed or uninstalled without issue.

Steps involved for uninstalling using pip

Following are the steps to uninstall a package or module using pip command −

Note − Installed packages that are directly on the system cannot be removed.

Example

Following example shows how to uninstall python module using pip command −

C:\Users\Lenovo>pip uninstall scipy

Output

Following is an output of the above code −

Found existing installation: scipy 1.8.1Uninstalling scipy-1.8.1: Would remove: c:\users\lenovo\appdata\local\programs\python\python310\lib\site-packages\scipy-1.8.1.dist-info\* c:\users\lenovo\appdata\local\programs\python\python310\lib\site-packages\scipy\*Proceed (Y/n)? y Successfully uninstalled scipy-1.8.1

Note − There are a few exceptions, though. Using pip, it is difficult to delete these packages:

  • Pure distutils packages installed with python setup.py install do not leave any metadata of the files they installed.

  • The script wrappers that Python setup.py develop install.

All files must be manually deleted, and any other activities performed during installation must be undone. If you are unsure about the complete list of files, you can reinstall it using the --record option and examine the results. To make a list of the installed file, you can use −

python setup.py install --record files.txt

Now that you have a list of all the files in the files.txt, you may manually delete them.

Uninstalling a package using conda

The main tool for managing package installations is the conda command. It can −

  • Form new environments for conda.
  • The Anaconda package index and current Anaconda installation can be queried and searched.
  • Installing and updating packages in conda environments that already exist.

Steps involved for uninstalling using conda

Following are the steps to uninstall a package or module using conda command −

  • To view a list of all the Anaconda virtual environments, open the Anaconda Navigator window and select the Environments menu item from the window's left side.

  • Select the Open Terminal menu option from the popup menu list after clicking the green triangle at the end of one Anaconda virtual environment.

  • It will enter your chosen anaconda virtual environment and start a dos or terminal window.

  • With the help of "conda uninstall module_name” command, uninstall the module.

  • To confirm the uninstall outcome, execute the conda list package-name command one more.

Example

Following example shows how to uninstall python module using conda command −

(base) C:\Users\Lenovo>conda uninstall numpy

Output

Following is an output of the above code

Collecting package metadata (repodata.json): doneSolving environment: done## Package Plan ## environment location: C:\Users\Lenovo\anaconda3 removed specs: - numpyThe following packages will be REMOVED: blas-1.0-mkl intel-openmp-2021.4.0-haa95532_3556 mkl-2021.4.0-haa95532_640 mkl-service-2.4.0-py39h2bbff1b_0 mkl_fft-1.3.1-py39h277e83a_0 mkl_random-1.2.2-py39hf11a4ad_0 numpy-1.23.1-py39h7a0a035_0 numpy-base-1.23.1-py39hca35cd5_0Proceed ([y]/n)? yPreparing transaction: doneVerifying transaction: doneExecuting transaction: done

Sarika Singh

Updated on: 23-Nov-2022

35K+ Views

  • Related Articles
  • An Introduction to Python CPLEX Module
  • How to Check If Python Package Is Installed?
  • How to retrieve Python module path?
  • How to install a Python Module?
  • How to develop a Python Module?
  • How to connect to an SAP module?
  • How to use the Subprocess Module in Python?
  • How can I delete an element in Selenium using Python?
  • How to check programmatically if an application is installed or not in Android?
  • Reading an image using Python OpenCv module
  • How do I know if Python has pandas installed?
  • How to Compress files with ZIPFILE module in Python.
  • How to list all functions in a Python module?
  • How to interface Arduino with a GSM module and delete all the read SMSes?
  • Introduction to Psycopg2 Module in Python
Kickstart Your Career

Get certified by completing the course

Get Started

How to delete an installed module in Python? (2)

Advertisem*nts

How to delete an installed module in Python? (2024)
Top Articles
Different Colored Candlesticks in Candlestick Charting
Business Law
Craigslist San Francisco Bay
Evil Dead Movies In Order & Timeline
Golden Abyss - Chapter 5 - Lunar_Angel
Tryst Utah
Shoe Game Lit Svg
What to Do For Dog Upset Stomach
Nc Maxpreps
Mohawkind Docagent
Evita Role Wsj Crossword Clue
Becky Hudson Free
Prices Way Too High Crossword Clue
Globe Position Fault Litter Robot
Valentina Gonzalez Leaked Videos And Images - EroThots
Raid Guides - Hardstuck
My.doculivery.com/Crowncork
New Stores Coming To Canton Ohio 2022
Busby, FM - Demu 1-3 - The Demu Trilogy - PDF Free Download
Kylie And Stassie Kissing: A Deep Dive Into Their Friendship And Moments
Bank Of America Financial Center Irvington Photos
Sadie Sink Reveals She Struggles With Imposter Syndrome
Suspiciouswetspot
Feathers
Phoenixdabarbie
Tom Thumb Direct2Hr
Page 2383 – Christianity Today
Rogold Extension
Mobile Maher Terminal
O'reilly's Wrens Georgia
First Light Tomorrow Morning
De beste uitvaartdiensten die goede rituele diensten aanbieden voor de laatste rituelen
El agente nocturno, actores y personajes: quién es quién en la serie de Netflix The Night Agent | MAG | EL COMERCIO PERÚ
Blue Beetle Movie Tickets and Showtimes Near Me | Regal
The Land Book 9 Release Date 2023
How to Destroy Rule 34
Quake Awakening Fragments
Gets Less Antsy Crossword Clue
Frank 26 Forum
Section 212 at MetLife Stadium
Ramsey County Recordease
Luvsquad-Links
Lucyave Boutique Reviews
Patricia And Aaron Toro
Unlock The Secrets Of "Skip The Game" Greensboro North Carolina
Scythe Banned Combos
9:00 A.m. Cdt
Lyons Hr Prism Login
VerTRIO Comfort MHR 1800 - 3 Standen Elektrische Kachel - Hoog Capaciteit Carbon... | bol
La Qua Brothers Funeral Home
Autozone Battery Hold Down
Olay Holiday Gift Rebate.com
Latest Posts
Article information

Author: Terence Hammes MD

Last Updated:

Views: 6222

Rating: 4.9 / 5 (69 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Terence Hammes MD

Birthday: 1992-04-11

Address: Suite 408 9446 Mercy Mews, West Roxie, CT 04904

Phone: +50312511349175

Job: Product Consulting Liaison

Hobby: Jogging, Motor sports, Nordic skating, Jigsaw puzzles, Bird watching, Nordic skating, Sculpting

Introduction: My name is Terence Hammes MD, I am a inexpensive, energetic, jolly, faithful, cheerful, proud, rich person who loves writing and wants to share my knowledge and understanding with you.