Fix: not working

If you are dealing with the “matplotlib” library, the “” method enables users to display the visual representation of numeric figures. This method is quite useful for creating interactive plots for analyzing data. While using the “” method, the error occurs in the terminal.

This article will address the multiple reasons and the solutions to resolve the error. The content of the post is as follows:

Let’s start the article.

Reason: “matplotlib” Library Not Installed

The “matplotlib” is the plotting library of python in python programming. It is utilized for 2D or 3D graphs from a python script. The main reason for causing the error “ not working” is that the above library is not installed in the current operating system.

Solution 1: Installed “matplotlib” Library

The best solution is to install the “matplotlib” library in the system to resolve errors. After the library installation, the “” will successfully execute without any hurdle. For this, the installation command for Linux distributions is given here:

$ sudo apt install python3-matplotlib              #Debian/Ubuntu-based
$ sudo dnf install python3-matplotlib              #Fedora-based
$ sudo pacman -S python-matplotlib                 #Arch-based

After the successful installation of the “matplotlib” library, execute the particular method that causes the error. Apart from that, the command executes the “” file:

$ python3

The “” method has been executed in the system.

Solution 2: Install the “matplotlib” Library

Another solution for installing the “matplotlib” library is through the pip package manager. The procedure is here for installing the particular library:

Install pip Package Manager

To install the package manager “pip” on your operating system, you need to run the following script that allows you to import the module: 

$ sudo dnf install python3-pip      # Fedora
$ sudo pacman -S python3-pip        # Arch-based
$ sudo apt install python3-pip      # Ubuntu, Mint

Install “matplotlib” Library

To import the “matplotlib” library from the “pip” manager, run the script here:

$ sudo dnf install python3-matplotlib # Fedora 
$ sudo pacman -S python-matplotlib      # Arch 
$ sudo pip3 install matplotlib        # Ubuntu

The output shows that “matplotlib” is already installed in the current system.

Verify method

To confirm the method, run the “” file on which the error is raised:

$ python3

The output ensures that the “” file has been executed.

That is how the “” method works in Linux.


In Linux, the error “ not working” come across due to the ‘matplotlib’ library not being installed in the operating system. To resolve the error, run the “sudo apt install python3-matplotlib” script in the terminal to install the ‘matplotlib’ library for the “” method. This post has explained multiple solutions to tackle the error.