Install matplotlib python3 CentOS server

Install matplotlib python3 CentOS server


Follow the below steps to install matplotlib on Python3 CentOS server.

1. Log into your Linux server via SSH as root user

2. matplotlib can be installed using pip

3. Run the command ‘pip3 install matplotlib’

4. import matplotlib to confirm it is installed correctly

How to install matplotlib on python3 server

How to install matplotlib on python3 server

Steps Explained :

First check the version of Python installed on your server.

[root@centos /]# python3 -V
Python 3.6.8

The below command checks whether python-pip is installed or not :

[root@centos /]# rpm -qa | grep -i pip


[root@centos /]# pip3 -V
pip 21.3.1

Run the command ‘yum install python-pip’ OR ‘yum install python3-pip’ to install python-pip package on your CentOS server.

pip is the package installer for Python. To install matplotlib using pip:

# pip3 install matplotlib

Import matplotlib to make sure it is installed correctly.

[root@centos /]# python3
Python 3.6.8 (default, Nov 21 2019, 19:31:34)
[GCC 8.3.1 20190507 (Red Hat 8.3.1-4)] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import matplotlib

OR you can run ‘pip3 freeze | grep -i matplotlib’ to confirm

[root@centos /]# pip3 freeze | grep -i matplot

refer the below URL if you want to install a specific version of matplotlib

matplotlib release page