How to Uninstall Python NumPy

Vaibhhav Khetarpal Feb 02, 2024
  1. Different Ways to Uninstall NumPy
  2. Linux
  3. Mac Os
  4. Windows
How to Uninstall Python NumPy

The NumPy libraries can sometimes be bugged, or the version installed might not be the version desired by the user. In these cases, there is a need to uninstall the NumPy library.

This tutorial demonstrates the different ways to uninstall the NumPy library in Python.

Different Ways to Uninstall NumPy

Linux

Use the pip Command to Uninstall NumPy

The pip command can install and uninstall most Python libraries through the console. No matter which OS you have, this command works on all the consoles.

Code - Python 3 Version:

sudo pip3 uninstall numpy

Code - Python 2 Version:

sudo pip uninstall numpy

Use the apt-get Command to Uninstall NumPy

The apt-get command gets information about the packages and downloads them. It can also be utilized to uninstall a package from Linux.

Code:

sudo apt-get remove python-numpy

Use the yum Command to Uninstall NumPy

The yum command is rarely used to remove a package, such as the NumPy library.

Code:

$ yum remove python3-numpy

Mac Os

Use the pip Command to Uninstall NumPy

Code:

pip3 uninstall numpy

The same tweaks as shown before apply to any Python 2 versions.

Use the brew Command to Uninstall NumPy

If you use the brew version of Python, they can always use the brew command to uninstall NumPy from their device.

Code:

brew uninstall numpy

Windows

Use the pip Command to Uninstall NumPy

Code:

pip3 uninstall numpy

The same tweaks as shown before apply to any Python 2 versions.

Uninstall Numpy From a Compiler

Some software programs act as a medium where we can make Python code found on Windows. These software programs generally do have access to the root.

There are several examples in Windows, like PyCharm or Anaconda. These applications usually have a list of the set of libraries in the system and are allowed to add/remove libraries by simply finding that option when interacting with the application’s User Interface.

Vaibhhav Khetarpal avatar Vaibhhav Khetarpal avatar

Vaibhhav is an IT professional who has a strong-hold in Python programming and various projects under his belt. He has an eagerness to discover new things and is a quick learner.

LinkedIn