You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried to install matplotlib using pip on Linux and it couldn't find freetype during the build process, even though it's installed with dev packages.
freetype: no [The C/C++ header for freetype2 (ft2build.h)
could not be found. You may need to install the
development package.]
But:
$ ls -l /usr/include/freetype2/ft2build.h
-rw-r--r-- 1 root root 2383 Mar 13 17:29 /usr/include/freetype2/ft2build.h
I've checked the setupext.py and it looks that for freetype it only checks for the ft2build.h in /usr/include and not in /usr/include/freetype2 even though it's added to list of checked directories for FreeType.
I have the same problem. I try to install matplotlib in a virtual environment on ubuntu server 14.04. freetype-devel has been installed (package libfreetype6-dev):
Never mind; upon further investigation, this is unrelated to #2623.
This bug only occurs if pkg-config is not installed; a simple
sudo apt-get install pkg-config
will shore up the include paths for now.
Reacted by Martin Noblia, Brennon Bortz, Joao Palotti, Ilia Schelokov, James Stone, Jiecheng Z, fravoi, Martin Hartkorn, Abdul Somat Budiaji, Chris Warth and 70 more
Reacted by Anh Tran (Adrian), farzadno and Guilherme Guerra
Reacted by Leric Zhang, Naoko Reeves, Miae Kim, Emanuel Schmitt, Enrique Herreros, Tadej Magajna, Matt Forrester, farzadno, v-schulz, arctanh and 3 more
Reacted by Samuel Carlsson, Pavel Borobov, Miae Kim, Emanuel Schmitt, Tadej Magajna, Keno Goertz, Duke Dorje, farzadno, Guilherme Guerra and AGSPhoenix
I'm having this problem on Windows 10, building matplotlib 1.5.1 for Python 2.7.11. I'm using the conda package manager. "conda build matplotlib" errors out with
BUILDING MATPLOTLIB
matplotlib: yes [1.5.1]
python: yes [2.7.11 |Continuum Analytics, Inc.| (default,
Feb 16 2016, 09:58:36) [MSC v.1500 64 bit (AMD64)]]
platform: yes [win32]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.11.0]
dateutil: yes [using dateutil version 2.5.3]
pytz: yes [using pytz version 2016.4]
cycler: yes [using cycler version 0.10.0]
tornado: yes [tornado was not found. It is required for the
WebAgg backend. pip/easy_install may attempt to
install it after matplotlib.]
pyparsing: yes [using pyparsing version 2.1.4]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
freetype: no [The C/C++ header for freetype (ft2build.h)
could not be found. You may need to install the
development package.]
png: yes [Using unknown version found on system.]
qhull: yes [pkg-config information for 'qhull' could not be
found. Using local copy.]
OPTIONAL SUBPACKAGES
sample_data: yes [installing]
toolkits: yes [installing]
tests: yes [nose 0.11.1 or later is required to run the
matplotlib test suite. Please install it with pip or
your preferred tool to run the test suite / mock is
required to run the matplotlib test suite. Please
install it with pip or your preferred tool to run
the test suite]
toolkits_tests: yes [nose 0.11.1 or later is required to run the
matplotlib test suite. Please install it with pip or
your preferred tool to run the test suite / mock is
required to run the matplotlib test suite. Please
install it with pip or your preferred tool to run
the test suite]
OPTIONAL BACKEND EXTENSIONS
macosx: no [Mac OS-X only]
qt5agg: no [PyQt5 not found]
qt4agg: no [PySide not found; PyQt4 not found]
gtk3agg: no [Requires pygobject to be installed.]
gtk3cairo: no [Requires cairocffi or pycairo to be installed.]
gtkagg: no [Requires pygtk]
tkagg: no [The C/C++ header for Tk (tk.h) could not be
found. You may need to install the development
package.]
wxagg: no [requires wxPython]
gtk: no [Requires pygtk]
agg: yes [installing]
cairo: no [cairocffi or pycairo not found]
windowing: yes [installing, installing]
OPTIONAL LATEX DEPENDENCIES
dvipng: no
ghostscript: no
latex: no
pdftops: no
OPTIONAL PACKAGE DATA
dlls: no [skipping due to configuration]
============================================================================
* The following required packages can not be built:
* freetype
freetype is installed. ft2build.h is present. There is no pkg-config for Windows. This seems like a real matplotlib config bug that is being covered over by punting to pkg-config. Wish it could be fixed.
@janssen I suggest you send this issue to the user mailing list (matplotlib-users@python.org which will require you to register to post un-moderated) or have a look at our appveyor configuration files (which build mpl in a conda env on windows).
Same problem here, sudo apt-get install pkg-config resolved it. It would be very helpful if the build script would either suggest checking pkg-config directly, or would point to this GitHub issue. It would certainly have saved me at least 15 minutes of trial and error before landing here.
I run your command by root user but get an error of 'Operation not permitted' on Mac.
And the command 'find / -name ft2build.h' get the flowing result:
Have this issue on ubuntu 16.04, python 3.5.2 (virtualenv), matplotlib 1.5.1 (installed via pip).
ft2build.h is in /usr/include/freetype2/ft2build.h
and sym linking it to /usr/include/ fixes it. $ ln -s /usr/include/freetype2/ft2build.h /usr/include/
OPTIONAL PACKAGE DATA
dlls: no [skipping due to configuration]
============================================================================
* The following required packages can not be built:
* freetype
Install C++ compiler for Python at link: https://www.microsoft.com/en-us/download/details.aspx?id=44266
If error about library, you can go to C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include
"no replace" to C:\Users\Yourname\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\include
Downloading https://files.pythonhosted.org/packages/26/04/8b381d5b166508cc258632b225adbafec49bbe69aa9a4fa1f1b461428313/matplotlib-3.0.3.tar.gz (36.6MB)
|¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 36.6MB 915kB/s
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-sp8h0mz6/matplotlib/setup.py'"'"'; file='"'"'/tmp/pip-install-sp8h0mz6/matplotlib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: /tmp/pip-install-sp8h0mz6/matplotlib/
Complete output (47 lines):
============================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [3.0.3]
python: yes [3.5.3 (default, Sep 27 2018, 17:25:39) [GCC
6.3.0 20170516]]
platform: yes [linux]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.17.2]
install_requires: yes [handled by setuptools]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
freetype: no [The C/C++ header for freetype2 (ft2build.h)
could not be found. You may need to install the
development package.]
png: no [pkg-config information for 'libpng' could not
be found.]
qhull: yes [pkg-config information for 'libqhull' could not
be found. Using local copy.]
OPTIONAL SUBPACKAGES
sample_data: yes [installing]
toolkits: yes [installing]
tests: no [skipping due to configuration]
toolkits_tests: no [skipping due to configuration]
OPTIONAL BACKEND EXTENSIONS
agg: yes [installing]
tkagg: yes [installing; run-time loading from Python Tcl /
Tk]
macosx: no [Mac OS-X only]
windowing: no [Microsoft Windows only]
OPTIONAL PACKAGE DATA
dlls: no [skipping due to configuration]
============================================================================
* The following required packages can not be built:
* freetype, png
* Try installing freetype with `apt-get install
* libfreetype6-dev` and pkg-config with `apt-get
* install pkg-config`
* Try installing png with `apt-get install
* libpng12-dev` and pkg-config with `apt-get install
* pkg-config`
----------------------------------------
ERROR: Command erred out with exit status 1: python setup.py egg_info Check the logs for full command output.
on raspbian stretch
sudo apt install libpng12-dev libfreetype6-dev
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:
I also encountered this problem in openEuler release 20.03 (LTS-SP1).
Package freetype-2.10.2-2.oe1.aarch64 is already installed.
After searching, I found that the problem can be solved by performing the following operations:
dnf install freetype-devel.aarch64 -y --nogpgcheck
Summarizing my experience + solution in case it helps anyone...
I encountered this error while pip installing matplotlib from a requirements.txt in a Docker image. In particular, I requested a specific older version of matplotlib (3.4.3) while also simultaneously installing/requesting the most recent version of Python (3.10), torch, etc.
Turns out pip will attempt to compile a packages on its own if it can't find a pre-compiled version in the public repositories. In my case, the slim Docker image didn't have the build tools necessary for pip to compile -> the freetype error.
The solution was simple: update the version of matplotlib i was requesting to one available pre-compiled.
Activity
tacaswell commentedon May 1, 2014
Can you provide any more details (distribution, version etc)?
kravietz commentedon May 1, 2014
Linux: Ubuntu 14.04 LTS
Libraries:
libfreetype6:amd64 2.5.2-1ubuntu2
libfreetype6-dev 2.5.2-1ubuntu2
Matplotlib matplotlib==1.3.1 (from pip)
I've checked the
setupext.pyand it looks that for freetype it only checks for theft2build.hin /usr/include and not in/usr/include/freetype2even though it's added to list of checked directories for FreeType.tacaswell commentedon May 1, 2014
I can not reproduce this in a virtual environment on 14.04.
kmike commentedon May 2, 2014
It looks similar to #2623. Even if it is not the same issue, are there plans for 1.3.2? :)
espdev commentedon May 7, 2014
I have the same problem. I try to install matplotlib in a virtual environment on ubuntu server 14.04. freetype-devel has been installed (package
libfreetype6-dev):But matplotlib does not find it.
tacaswell commentedon May 7, 2014
@espdev What version of mpl?
espdev commentedon May 7, 2014
@tacaswell Version 1.3.1 from PyPI.
razius commentedon May 16, 2014
A temporary fix would be to create a symlink before installing matplotlib using pip.
steko commentedon May 24, 2014
I found the same issue on Debian unstable with Matplotlib 1.3.1 (both from PyPI and the tag release on github - although I think they're the same).
The fix by @razius at https://github.com/razius/matplotlib/commit/66ee42d194bef1d045918c54cc81a9cb186bd440 works for me and I managed to install matplotlib from source after applying the same patch to
setupext.pybenesch commentedon May 28, 2014
@kmike agreed, this looks like it's fixed by #2623.
@steko @kravietz @espdev does installing from the 1.3.x branch work?
If so, @tacaswell I renew my request for a 1.3.2.
benesch commentedon May 28, 2014
Never mind; upon further investigation, this is unrelated to #2623.
This bug only occurs if pkg-config is not installed; a simple
will shore up the include paths for now.
tacaswell commentedon May 29, 2014
Closing this as #3067 is merged into master.
@benesch The issue with 1.3.2 is devs having enough time to produce one. As you can see we are swamped trying to get 1.4.0 out.
post2web commentedon Nov 27, 2014
Same here.
did the trick31 remaining items
janssen commentedon Jun 16, 2016
I'm having this problem on Windows 10, building matplotlib 1.5.1 for Python 2.7.11. I'm using the conda package manager. "conda build matplotlib" errors out with
freetype is installed. ft2build.h is present. There is no pkg-config for Windows. This seems like a real matplotlib config bug that is being covered over by punting to pkg-config. Wish it could be fixed.
tacaswell commentedon Jun 17, 2016
@janssen I suggest you send this issue to the user mailing list (matplotlib-users@python.org which will require you to register to post un-moderated) or have a look at our appveyor configuration files (which build mpl in a conda env on windows).
kubark42 commentedon Jun 24, 2016
Same problem here,
sudo apt-get install pkg-configresolved it. It would be very helpful if the build script would either suggest checkingpkg-configdirectly, or would point to this GitHub issue. It would certainly have saved me at least 15 minutes of trial and error before landing here.TuringZhu commentedon Jul 4, 2016
@razius
I run your command by root user but get an error of 'Operation not permitted' on Mac.
And the command 'find / -name ft2build.h' get the flowing result:
cfblaeb commentedon Jul 19, 2016
Have this issue on ubuntu 16.04, python 3.5.2 (virtualenv), matplotlib 1.5.1 (installed via pip).
ft2build.h is in /usr/include/freetype2/ft2build.h
and sym linking it to /usr/include/ fixes it.
$ ln -s /usr/include/freetype2/ft2build.h /usr/include/iacchus commentedon Jan 5, 2017
Then
Which, by the way, is exactly the only error that the output is clearly saying.
OnlyBelter commentedon Dec 25, 2017
If you are using docker, and install matplotlib in
python:3.5-alpine, add this in yourDockerfilemay hlep:z-pc commentedon Jan 12, 2018
If you're installing matplotlib in windows.
Then try:
1.1 Follow def get_base_dirs():
1.2. "Try" replace win_bases = ['win32_static', ] -> win_bases = ['C:\Program Files\Anaconda2\Library', ]
If error about library, you can go to C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include
"no replace" to C:\Users\Yourname\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\include
Update .travis.yml
pkg-config
stardigits commentedon Jul 23, 2019
In termux solve by:
maximlomans commentedon Dec 12, 2019
Downloading https://files.pythonhosted.org/packages/26/04/8b381d5b166508cc258632b225adbafec49bbe69aa9a4fa1f1b461428313/matplotlib-3.0.3.tar.gz (36.6MB)
|¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 36.6MB 915kB/s
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-sp8h0mz6/matplotlib/setup.py'"'"'; file='"'"'/tmp/pip-install-sp8h0mz6/matplotlib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: /tmp/pip-install-sp8h0mz6/matplotlib/
Complete output (47 lines):
============================================================================
Edit setup.cfg to change the build options
ERROR: Command erred out with exit status 1: python setup.py egg_info Check the logs for full command output.
on raspbian stretch
sudo apt install libpng12-dev libfreetype6-dev
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:
sudo apt install libpng12-0 libpng12-dev libpng-tools libfreetype6-dev
sudo apt install libxslt libxml2 libxml2-dev python3-libxml2 python3-libxml2-dbg python3-lxml python3-lxml-dbg python3-testscenarios python3-jsonschema
*not yet done yet pip3 still glitching installing pymzq & kiwisolver
tacaswell commentedon Dec 12, 2019
@marxenegls Can you open a topic at https://discourse.matplotlib.org/c/community/install for installing Matplotlib on rasbian?
liuqinfei commentedon May 24, 2021
I also encountered this problem in openEuler release 20.03 (LTS-SP1).
Package freetype-2.10.2-2.oe1.aarch64 is already installed.
After searching, I found that the problem can be solved by performing the following operations:
dnf install freetype-devel.aarch64 -y --nogpgcheck
JakeColor commentedon Jul 14, 2022
Summarizing my experience + solution in case it helps anyone...
I encountered this error while pip installing matplotlib from a requirements.txt in a Docker image. In particular, I requested a specific older version of matplotlib (3.4.3) while also simultaneously installing/requesting the most recent version of Python (3.10), torch, etc.
Turns out pip will attempt to compile a packages on its own if it can't find a pre-compiled version in the public repositories. In my case, the slim Docker image didn't have the build tools necessary for pip to compile -> the freetype error.
The solution was simple: update the version of matplotlib i was requesting to one available pre-compiled.