How to Uninstall Python Packages

All Python package management solutions provide the basic function of uninstalling packages, including pip, pipenv and the ActiveState Platform. However, unless specifically defined in a requirements.txt or pipfile.lock, package managers will not deal with transitive dependencies (ie., dependencies of dependencies).
In this article, we explain how to uninstall Python packages using these democratic tools and we besides introduce you to the ActiveState Platform. The AS Platform is singular in mechanically installing and uninstalling transitive dependencies. Our addiction management system makes it possible to track conflicts between packages, know about platform-specific dependencies, and even track system-level dependencies like C and C++ libraries. Once you are done read, you can try the ActiveState Platform by signing up for a free account .
Read on to understand how to work with Pip and Pipenv Package Managers to uninstall Python packages.

checklist

Before packages can be uninstalled, ensure that a Python facility containing the necessary files needed for uninstalling packages is in invest. installation Requirements ( for Windows ).

How to Uninstall Packages Installed with Pip

To uninstall a software :

 pip uninstall 

How to Uninstall Packages in a Python Virtual Environment

Packages can be uninstalled from a virtual environment using pip or pipenv .
To use spot to uninstall a package locally in a virtual environment :

  1. Open a command or terminal window ( depending on the operate system )
  2. compact disk into the project directory
  3. pip uninstall

To use pipenv to uninstall a box locally in a virtual environment created with venv or virtualenv :

  1. Open a command or terminal window ( depending on the operate system )
  2. certificate of deposit into the visualize directory
  3. pipenv uninstall

How to Globally Uninstall Python Packages

In some cases, packages may be installed both locally ( e.g., for use in a specific project ) and system-wide. To ensure a box is wholly removed from your system after you ’ ve uninstalled it locally, you ’ ll besides need to uninstall it globally .
To uninstall a package globally in Windows :

    1. Open a command window by entering ‘ cmd ’ in the Search Box of the Task bar
    2. Press Ctrl+Shift+Enter to gain Administration ( Admin ) privileges
    3. pip uninstall

To uninstall a software globally in Linux :

    1. Open a terminal windowpane
    2. sudo su pip uninstall

How to Uninstall Package Dependencies with Pip

When you install a package with shoot, it besides installs all of the dependencies the software requires. unfortunately, worst does not uninstall dependencies when you uninstall the original software. here are a pair of different procedures that can be used to uninstall dependencies .

  1. If a package has been installed via a worst requirements file ( i.e., shoot install requirements.txt ), all of the packages in requirements.txt can be uninstalled with the following command :
 pip uninstall requirements.txt
  1. If a requirements.txt file is not available, you can use the shoot show command to output signal all the requirements of a intend box :
 pip testify 

Example :

 worst express cryptanalysis

output should be similar to :

 'Requires : six, cffi '

These dependencies can then be uninstalled with the shoot uninstall command. however before uninstalling, you should ensure that the packages are NOT dependencies for early existing packages .

How to Uninstall Package Dependencies with Pipenv

To uninstall all the dependencies in a Pipenv project :

  1. Open a command or terminal windowpane
  2. candle into the plan directory
  3. pipenv uninstall --all

How to Uninstall a package Installed With Setuptools

Any packages that have been configured and installed with setuptools used the following control :

 python setup.py install 

unfortunately, there is no python setup.py uninstall command. To uninstall a software installed with setup.py, use the pip command :

 pip uninstall 

Be mindful that there are a few exceptions that can not be uninstalled with worst, including :

  • Distutils packages, which do not provide metadata indicating which files were installed .
  • Script wrappers installed by the setup.py develop command .

future Steps

Resolving packages when installing or uninstalling an environment can be an extremely slow (or even manual) process. You can speed things up considerably using the ActiveState Platform, which automatically resolves dependencies for you–fast! Get started free on the ActiveState Platform.
Or good install Python 3.9 and use the include instruction line interface, the State Tool, to “ state install ” the packages you need :

 > department of state install numpy

 ╔════════════════════╗
 ║ Installing Package ║
 ╚════════════════════╝

 Updating Runtime

 ────────────────

 Changes to your runtime may require some dependencies to be rebuilt .

 numpy includes 2 dependencies, for a combined sum of 8 newfangled dependencies .

 Building 8/8

 Installing 8/8 

 software added : numpy

Python 3.9 Web GUI Graphic

reservoir : https://thefartiste.com
Category : Tech

About admin

I am the owner of the website thefartiste.com, my purpose is to bring all the most useful information to users.

Check Also

articlewriting1

Manage participants in a zoom meeting webinar

Call the people who attend the meet as follows Alternate host host Who scheduled the …

Leave a Reply

Your email address will not be published.