Install matplotlib and matplotlib

Source: Internet
Author: User
Tags install matplotlib

Install matplotlib and matplotlib

1. Install matplotlib in Linux

If you are using the Python version that comes with the system, you can use the Package Manager of the system to install matplotlib. Therefore, you only need to execute one line of command:

$ Sudo apt-get install python3-matplotlib

If we use Python2.7, run the following command:

  $ Sudo apt-get install python-matplotlib

If we have installed a newer Python version, we must install some libraries that matplotlib depends on:

$ Sudo apt-get install python3.5-dev python3.5-tk-dev

$ Sudo apt-get install libfreetype6-dev g ++

Then use pip to install matplotlib:

$ Pip install -- user matplotlib

Ii. Test matplotlib

Install the necessary packages and test the installation. To solve this problem, run python or Python3 to start a terminal session and try to import matplotlib:

$ Python3
>>> Import matplotlib
>>>

If no error message is displayed, it indicates that matplotlib is installed in our system.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.