comprehensive library for creating static, animated, and interactive visualizations in Python
Matplotlib (portmanteau of MATLAB, plot, and library) is a plotting library for the Python programming language and its numerical mathematics extension NumPy. It provides an object-oriented API for embedding plots into applications … Wikipedia
Factsheet
Original author John D. Hunter
Developers Michael Droettboom, et al.
Initial release 2003; 23 years ago (2003)
Factsheet
Original author John D. Hunter
Developers Michael Droettboom, et al.
Initial release 2003; 23 years ago (2003)
🌐
Matplotlib
matplotlib.org › stable › install › index.html
Installation — Matplotlib 3.10.8 documentation
Please make sure you are using uv 0.8.7 or newer (update with e.g. uv self update) and that your bundled Python installs are up to date (with uv python upgrade --reinstall). Alternatively, you can use one of the other supported GUI frameworks, e.g. ... Matplotlib releases are available as wheel packages for macOS, Windows and Linux on PyPI.
🌐
PyPI
pypi.org › project › matplotlib
matplotlib · PyPI
Matplotlib produces publication-quality figures in a variety of hardcopy formats and interactive environments across platforms. Matplotlib can be used in Python scripts, Python/IPython shells, web application servers, and various graphical user interface toolkits. See the install documentation, which is generated from /doc/install/index.rst
      » pip install matplotlib
    
Published   Dec 10, 2025
Version   3.10.8
Discussions

python - How to install matplotlib - Stack Overflow
I installed python3.2 in ubuntu (the default edition is not deleted), and I follow the steps in here However when i use python3.2 setup.py install I got: "error: command 'gcc' failed with exit More on stackoverflow.com
🌐 stackoverflow.com
How to install a library (matplotlib)
My guess is that you installed matplotlib in your global python install, but PyCharm uses a virtual python environment per project. If true, you need to install matplotlib in that virtual environment. In the terminal, first make sure your virtual environment is activated. I have never used PyCharm, so I can't give any PyCharm specific help. But if the virtual environment is in a venv/ subfolder of your project folder, you probably just need to write this command in a terminal after cd'ing to the project folder: . venv/bin/activate (Note that the command starts with a dot and a space. This is needed on Linux, and I also assume it is needed on Mac. It is not needed on Windows.) Then install the matplotlib package with this command: python -m pip install matplotlib Do not run pip directly. Sometimes it will work, sometimes it will not. Always run it with the python -m pip command. This ensures that pip is running under your currently active environment and installs packages under that environment. More on reddit.com
🌐 r/learnpython
5
2
March 16, 2024
Installing Matplotlib for new users - Installation - Matplotlib
In the installing Matplotlib Section, we can document the installation procedure separately for Windows and Mac for better understanding. NOTE: You need to install latest version of Python before you install Matplotlib On a Mac Laptop Step 1: After Python is installed, Open a new Terminal App ... More on discourse.matplotlib.org
🌐 discourse.matplotlib.org
0
June 9, 2020
How to install Matplotlib in Python 3 on Windows - Stack Overflow
Matplotlib tell us that the requirement is Python 2.4 or later but not Python3. Now I'm working with Python3 and I need some plot from Matplotlib. So how do I solve it? More on stackoverflow.com
🌐 stackoverflow.com
🌐
Alma Better
almabetter.com › bytes › articles › how-to-install-matplotlib-in-python
How to Install Matplotlib in Python with Detailed Steps
May 4, 2025 - Learn how to install Matplotlib in Python with this detailed, step-by-step guide. Follow simple commands to set up Matplotlib on Windows, macOS or Linux easily
Top answer
1 of 6
51

Matplotlib supports python 3.x as of version 1.2, released in January, 2013.

To install it, have a look at the installation instructions. In general, call pip install matplotlib or use your preferred mechanism (conda, homebrew, windows installer, system package manager, etc). In some cases you may need to install additional non-python dependencies (libpng and freetype) through your system's package manager.

The answer below is left for historical reasons and as an example of installing the development version from github.


The current release of matplotlib doesn't support python3.

There's a github branch for python3 support for a couple of years now, but it hasn't been stable on anything other than linux until fairly recently. I believe that branch was recently merged back into the main branch.

If you want to use matplotlib on python3, you'll need to build from the current tip https://github.com/matplotlib/matplotlib

To build it, do something similar to the following:

git clone https://github.com/matplotlib/matplotlib
cd matplotlib
python3 setup.py build
sudo python3 setup.py install

If you don't have git installed, then you can just download a tarball of the current git tip instead: https://github.com/matplotlib/matplotlib/tarball/master

You'll need to have numpy installed for python3. (Installing it for python2 doesn't install it for python3.)

In most cases, that's all you'll need to do. For a default install, the only non-included python library is numpy. The other dependencies (e.g. libpng, freetype) are system libraries and if you can build matplotlib for python2, you already have them.

If you want a non-default install (e.g. if you want any of the non-default backends), then you'll need to copy the setup.cfg.default template to setup.cfg and edit it to match what you want. You'll probably only need to do this if you're planning to embed matplotlib in a gtk or qt application that you're writing, in which case you'll want the gtkagg or qtagg backends instead of just the default tkagg backend.

2 of 6
23

just to bump @endolith's comment up to answer level, from at least uBuntu 14-04 linux onwards, matplotlib support for python3 is built-in with apt:

sudo apt-get install python3-matplotlib

should install matplotlib for python3 with the necessary dependencies.

🌐
W3Schools
w3schools.com › python › matplotlib_getting_started.asp
Matplotlib Getting Started
If you have Python and PIP already installed on a system, then installation of Matplotlib is very easy.
🌐
Reddit
reddit.com › r/learnpython › how to install a library (matplotlib)
r/learnpython on Reddit: How to install a library (matplotlib)
March 16, 2024 -

So I need to install matplotlib for a school project, and I've installed pip on my mac already. I've verified that I installed it on terminal, but now I don't know how to install or use matplotlib. I wrote "pip install matplotlib", and something seemed to be happening. At the end it said successfully installed, but if I write "import matplotlib" in pycharm it doesnt work...

The tutorial websites dont say anything, or at least I couldnt find anything
What do I do?

🌐
Matplotlib
discourse.matplotlib.org › community › installation
Installing Matplotlib for new users - Installation - Matplotlib
June 9, 2020 - NOTE: You need to install latest ... -m pip install -U pip” Step 3: Install Matplotlib using command “ python -m pip install -U matplotlib” Step 4: Wait for few......
Find elsewhere
🌐
TutorialsPoint
tutorialspoint.com › how-to-install-matplotlib-in-python
How to install matplotlib in Python?
August 31, 2023 - Type the following commands in ... The version of pip will be displayed, if it is successfully installed on your system. Matplotlib can be installed using pip....
🌐
Matplotlib
matplotlib.org › 3.1.1 › users › installing.html
Installing — Matplotlib 3.1.2 documentation
If you are on Linux, you might prefer to use your package manager. Matplotlib is packaged for almost every major Linux distribution. Debian / Ubuntu: sudo apt-get install python3-matplotlib
🌐
GeeksforGeeks
geeksforgeeks.org › installation guide › install-matplotlib-python
How to Install Matplotlib on python? - GeeksforGeeks
July 18, 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.
🌐
Scaler
scaler.com › home › topics › matplotlib › how to install matplotlib in python?
How to Install Matplotlib in Python? - Scaler Topics
April 20, 2024 - Check if pip3 and python3 are installed correctly by running the following command: ... Download python from the official website according to your operating system and install it.
🌐
Matplotlib
matplotlib.org › 1.4.3 › faq › installing_faq.html
Installation — Matplotlib 1.4.3 documentation
Instead, we recommend that you use the “Add Software” method for your system to install matplotlib. This will guarantee that everything that is needed for matplotlib will be installed as well. If, for some reason, you can not use the package manager, Linux usually comes with at least a basic build system. Follow the instructions found above for how to build and install matplotlib.
🌐
University of Vermont
uvm.edu › ~cbcafier › python-tooling › matplotlib_mac.html
Installing Matplotlib (macOS) – Clayton Cafiero
January 5, 2025 - Once this is done, you should see a screen indicating that matplotlib has been installed. Click the button labeled “Close.” · In the Python shell (within Thonny) type import matplotlib at the prompt and hit return. If you arrive at another prompt without any errors displayed you should be good to go!
🌐
YouTube
youtube.com › watch
How to Install Matplotlib in Visual Studio Code - YouTube
How to Install Matplotlib in Visual Studio Code (VS Code) | Step-by-Step GuideWant to create **beautiful data visualizations** using Python in **Visual Stud...
Published   March 21, 2025
🌐
Matplotlib
matplotlib.org › 3.5.2 › users › installing › index.html
Installation — Matplotlib 3.5.2 documentation
Debian / Ubuntu: sudo apt-get install python3-matplotlib ... If you are interested in contributing to Matplotlib development, running the latest source code, or just like to build everything yourself, it is not difficult to build Matplotlib from source.
🌐
Matplotlib
matplotlib.org › 1.4.2 › faq › installing_faq.html
Installation — Matplotlib 1.4.2 documentation
Instead, we recommend that you use the “Add Software” method for your system to install matplotlib. This will guarantee that everything that is needed for matplotlib will be installed as well. If, for some reason, you can not use the package manager, Linux usually comes with at least a basic build system. Follow the instructions found above for how to build and install matplotlib.
🌐
Matplotlib
matplotlib.org › stable › users › installing › index.html
Installation — Matplotlib 3.8.4 documentation
May 28, 2023 - Matplotlib makes nightly development build wheels available on the scientific-python-nightly-wheels Anaconda Cloud organization. These wheels can be installed with pip by specifying scientific-python-nightly-wheels as the package index to query:
🌐
Matplotlib
matplotlib.org › 2.0.0 › users › installing.html
Installing — Matplotlib 2.0.0 documentation
If you are on Linux, you might prefer to use your package manager. matplotlib is packaged for almost every major Linux distribution. Debian / Ubuntu : sudo apt-get install python-matplotlib
🌐
Matplotlib
matplotlib.org › 2.2.0 › users › installing.html
Installing — Matplotlib 2.2.0 documentation
If you are on Linux, you might prefer to use your package manager. Matplotlib is packaged for almost every major Linux distribution. Debian / Ubuntu: sudo apt-get install python3-matplotlib