UBUNTU16 installation Matplotlib

Source: Internet
Author: User
Tags install matplotlib

There are a lot of problems when installing Ubuntu installation matplotlib, simply make a memo:

It is necessary to install its dependent packages libpng and FreeType first

Install libpng:

sudo apt-get install Libpng-dev

Install FreeType:

CD ~/downloads

wget https://download.savannah.gnu.org/releases/freetype/freetype-2.4.10.tar.gz

Tar zxvf freetype-2.4.10.tar.gz

CD freetype-2.4.10/

./congfigure

Make

sudo make install

Install PIP and then install Matplotlib via PIP:

sudo apt-get install Python-pip

After the PIP is installed, you can use the following command to find the Matplotlib and view its installation status

sudo pip search matplotlib

Installing Matplotlib

sudo pip install matplotlib

1.no module named Configparser

Pip Install Configparser

or sudo aptitude install Python-configparser

The reason for this problem is that Python3 did not configparser the module, and in order to follow THE PEP 8 standard, it has been renamed Configparser.

Through the error can see where the problem of the file, we switch to the folder where the file, mine is/usr/bin/. If through the general thinking, that the syntax of the file into a python3, then you can solve this problem, but will report other errors, you can follow the error prompts all the relevant files and modules have been changed to python3 syntax, but the workload is cumbersome.

Another way: Through LS we can see that there is a file called Pycompile, there is a file called Py3compile, the former follows the python2 syntax, and we use the PIP is the use of Pycompile, We just need to overwrite the content in the Py3compile with the content in the Pycompile, so we can solve the problem.

Note: The above is the problem I found in using ubuntu16.04 to install and use PIP, ubuntu16.04 test success

2. Fatal error:python.h:no such file or directory

For Python version 2.x+

$ sudo apt-get install Python-dev

OR
# Apt-get Install Python-dev
For Python version 3.x+

$ sudo apt-get install Python3-dev

OR
# Apt-get Install Python3-dev

UBUNTU16 installation Matplotlib

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.