Install the Matplotlib Package in Python

To install the Matplotlib package in Python:

pip install matplotlib

Note that the above command would only work if you already added Python to the Path. Otherwise, check the steps below to install the Matplotlib package in Python.

Steps to Install the Matplotlib Package in Python

(1) Locate the Python Scripts folder using these steps:

  • Type “Python” in the Windows Search Bar
  • Right-click on the Python App, and then select “Open file location
  • Right-click again on the Python shortcut, and then select “Open file location
  • Double-click on the “Scripts” folder

(2) In the address bar of the Scripts folder (where the path of the folder is displayed), type “cmd“:

cmd

(3) Press Enter, and you’ll see the Command Prompt pointing the Scripts folder:

C:\Users\Ron\AppData\Local\Programs\Python\Python312\Scripts>

(4) Type the command to install the Matplotlib package:

pip install matplotlib

(5) Press Enter to complete the installation:

Successfully installed matplotlib