error install matplotlib

Running matplotlib-3.2.0rc1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-l2nemy08/matplotlib-3.2.0rc1/egg-dist-tmp-mncyi377
UPDATING build/lib.linux-aarch64-3.6/matplotlib/_version.py
set build/lib.linux-aarch64-3.6/matplotlib/_version.py to ‘3.2.0rc1’
src/checkdep_freetype2.c:3:6: error: #error “FreeType version 2.3 or higher is required. You may set the MPLLOCALFREETYPE environment variable to 1 to let Matplotlib download it.”
#error "FreeType version 2.3 or higher is required.
^~~~~
src/checkdep_freetype2.c:10:10: error: #include expects “FILENAME” or
#include FT_FREETYPE_H
^~~~~~~~~~~~~
src/checkdep_freetype2.c:15:9: note: #pragma message: Compiling with FreeType version FREETYPE_MAJOR.FREETYPE_MINOR.FREETYPE_PATCH.
#pragma message("Compiling with FreeType version "
^~~~~~~
src/checkdep_freetype2.c:18:4: error: #error “FreeType version 2.3 or higher is required. You may set the MPLLOCALFREETYPE environment variable to 1 to let Matplotlib download it.”
#error "FreeType version 2.3 or higher is required.
^~~~~
error: Setup script exited with error: command ‘aarch64-linux-gnu-gcc’ failed with exit status 1

Hi 610215095, it’s recommend to install matplotlib through apt:

# Python 2.7
$ sudo apt-get install python-matplotlib

# Python 3.6
$ sudo apt-get install python3-matplotlib

Reading package lists… Done
Building dependency tree
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
python3-matplotlib : Depends: python3-numpy (>= 1:1.10.0~b1) but it is not going to be installed
Depends: python3-numpy-abi9
Depends: python3 (< 3.6) but 3.6.7-1~18.04 is to be installed
Recommends: python3-pil but it is not going to be installed
Recommends: python3-tk but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I recieved this error

i do face same error while installing matplotlib

what if the output of the execution of the command below?

sudo apt install python3-numpy

Similar issue while installing scipy was recently discussed in the Jetson-Nano subforum (sorry, i am too lazy to find the link to it).

Try installing Freetype by "sudo apt install libfreetype6-dev ".

Also I wouldn’t use the apt packages for numpy, matplotlib, scipy etc. as they are often outdated.
Install PIP instead: sudo apt-get install python3-pip
The update PIP itself: pip3 install -U pip
Finally install numpy and matplotlib: pip3 install numpy matplotlib

1 Like

This issue is fixing by upgrading python to 3.8 with latest Matplotlib…

I do face the same issue but installing scikit-image too.I can’t install scikit-image by

[code]
sudo pip3 install scikit-image --user

sudo apt install python3-scikit-image

[code]

I can install nothing but numpy by using pip3,it stuck like this picture below.I’m in China and I add a tsinghua pip mirror source,did it can cause any issue?


How can I install scikit-image?