Last modified: Jun 18, 2025 By Alexander Williams

How to Uninstall Matplotlib in Python

Matplotlib is a popular Python library for data visualization. Sometimes, you may need to uninstall it. This guide will show you how.

Why Uninstall Matplotlib?

You might need to uninstall Matplotlib for several reasons. Maybe you want to reinstall a different version. Or you need to free up space.

Whatever the reason, uninstalling Matplotlib is simple. Follow the steps below.

Check if Matplotlib is Installed

Before uninstalling, check if Matplotlib is installed. Use the pip show command in your terminal.

 
pip show matplotlib


Name: matplotlib
Version: 3.7.1
Summary: Python plotting package

If Matplotlib is installed, you will see its details. If not, you will get a "not found" message.

Uninstall Matplotlib Using pip

The easiest way to uninstall Matplotlib is using pip. Run the following command.

 
pip uninstall matplotlib


Uninstalling matplotlib-3.7.1:
  Would remove ...
Proceed (Y/n)? Y
  Successfully uninstalled matplotlib-3.7.1

Confirm the uninstall by typing Y and pressing Enter. Matplotlib will be removed.

Uninstall Matplotlib Using Conda

If you use Anaconda, uninstall Matplotlib with conda. Run this command.

 
conda remove matplotlib


The following packages will be removed:
  matplotlib
Proceed ([y]/n)? y

Type y to confirm. Conda will remove Matplotlib and its dependencies.

Verify the Uninstallation

After uninstalling, verify Matplotlib is gone. Use the pip show command again.

 
pip show matplotlib


WARNING: Package(s) not found: matplotlib

This confirms Matplotlib is no longer installed. You can also check in Python.

 
import matplotlib


ModuleNotFoundError: No module named 'matplotlib'

Troubleshooting

If you face issues, try these steps. First, use pip with the --verbose flag.

 
pip uninstall matplotlib --verbose

This gives more details. If Matplotlib is still there, force the uninstall.

 
pip uninstall matplotlib -y

This skips the confirmation prompt. For more help, see our guide on how to uninstall Python libraries.

Reinstall Matplotlib

If you need Matplotlib again, reinstall it easily. Use pip or conda.

 
pip install matplotlib

Or with Conda.

 
conda install matplotlib

Conclusion

Uninstalling Matplotlib is simple. Use pip or conda depending on your setup. Always verify the uninstall.

For related guides, check out how to uninstall Pandas or how to uninstall NumPy.