How to Install Matplotlib on python?
Last Updated :
18 Jul, 2025
Matplotlib is a Python library used for creating 2D plots and visualizations. It is built on top of NumPy and works well with the broader SciPy stack. This guide explains how to install Matplotlib on Windows using both Conda and PIP.
Installation Using Conda
If you're using Anaconda, you can install Matplotlib using the following command:
conda install matplotlib
Type 'y' when prompted to proceed with the installation.
You will get a similar message once the installation is complete. As seen below:

Best Practice
It’s recommended to install Matplotlib in a separate environment rather than in the base environment. Use these commands:
conda create -n my-env
conda activate my-env
conda install matplotlib
Optional: Use conda-forge (if preferred)
conda config --env --add channels conda-forge
conda install matplotlib
Installation Using PIP
pip install matplotlib command can be used to install it. Users who prefer to use pip can use the below command to install Matplotlib:
pip install matplotlib
This will download and install the latest version of Matplotlib from the Python Package Index (PyPI). You will get a similar message once the installation is complete:

Verifying Installation
To check if Matplotlib has been installed correctly, run the following in your Python environment:
import matplotlib
print(matplotlib.__version__)
If it prints the version number (e.g., 3.8.2), the installation was successful.

Related Articles: