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