New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

freetype cannot be found by build #3029

Closed
kravietz opened this Issue May 1, 2014 · 50 comments

Comments

Projects
None yet
@kravietz

kravietz commented May 1, 2014

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

And:

$ freetype-config --cflags
-I/usr/include/freetype2
@tacaswell

This comment has been minimized.

Show comment
Hide comment
@tacaswell

tacaswell May 1, 2014

Member

Can you provide any more details (distribution, version etc)?

Member

tacaswell commented May 1, 2014

Can you provide any more details (distribution, version etc)?

@kravietz

This comment has been minimized.

Show comment
Hide comment
@kravietz

kravietz 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.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.

kravietz commented 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.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.

@tacaswell

This comment has been minimized.

Show comment
Hide comment
@tacaswell

tacaswell May 1, 2014

Member

I can not reproduce this in a virtual environment on 14.04.

Member

tacaswell commented May 1, 2014

I can not reproduce this in a virtual environment on 14.04.

@kmike

This comment has been minimized.

Show comment
Hide comment
@kmike

kmike May 2, 2014

Contributor

It looks similar to #2623. Even if it is not the same issue, are there plans for 1.3.2? :)

Contributor

kmike commented May 2, 2014

It looks similar to #2623. Even if it is not the same issue, are there plans for 1.3.2? :)

@espdev

This comment has been minimized.

Show comment
Hide comment
@espdev

espdev 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):

esp@ubuntu-srv:~/temp$ locate freetype | grep ft2build.h
/usr/include/freetype2/ft2build.h

But matplotlib does not find it.

espdev commented 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):

esp@ubuntu-srv:~/temp$ locate freetype | grep ft2build.h
/usr/include/freetype2/ft2build.h

But matplotlib does not find it.

@tacaswell

This comment has been minimized.

Show comment
Hide comment
@tacaswell

tacaswell May 7, 2014

Member

@espdev What version of mpl?

Member

tacaswell commented May 7, 2014

@espdev What version of mpl?

@espdev

This comment has been minimized.

Show comment
Hide comment
@espdev

espdev May 7, 2014

@tacaswell Version 1.3.1 from PyPI.

espdev commented May 7, 2014

@tacaswell Version 1.3.1 from PyPI.

@razius

This comment has been minimized.

Show comment
Hide comment
@razius

razius May 16, 2014

Contributor

A temporary fix would be to create a symlink before installing matplotlib using pip.

$ ln -s /usr/include/freetype2/ft2build.h /usr/include/
Contributor

razius commented May 16, 2014

A temporary fix would be to create a symlink before installing matplotlib using pip.

$ ln -s /usr/include/freetype2/ft2build.h /usr/include/

@tacaswell tacaswell added this to the v1.4.0 milestone May 16, 2014

@steko

This comment has been minimized.

Show comment
Hide comment
@steko

steko 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.py

steko commented 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.py

@benesch

This comment has been minimized.

Show comment
Hide comment
@benesch

benesch 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?

pip install https://codeload.github.com/matplotlib/matplotlib/tar.gz/v1.3.x

If so, @tacaswell I renew my request for a 1.3.2.

benesch commented 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?

pip install https://codeload.github.com/matplotlib/matplotlib/tar.gz/v1.3.x

If so, @tacaswell I renew my request for a 1.3.2.

@benesch

This comment has been minimized.

Show comment
Hide comment
@benesch

benesch 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

sudo apt-get install pkg-config

will shore up the include paths for now.

benesch commented 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

sudo apt-get install pkg-config

will shore up the include paths for now.

@tacaswell

This comment has been minimized.

Show comment
Hide comment
@tacaswell

tacaswell May 29, 2014

Member

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.

Member

tacaswell commented 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

This comment has been minimized.

Show comment
Hide comment
@post2web

post2web Nov 27, 2014

Same here.

sudo apt-get install pkg-config 
did the trick

post2web commented Nov 27, 2014

Same here.

sudo apt-get install pkg-config 
did the trick
@gawbul

This comment has been minimized.

Show comment
Hide comment
@gawbul

gawbul Feb 11, 2015

Same here - pkg-config wasn't installed!

gawbul commented Feb 11, 2015

Same here - pkg-config wasn't installed!

brucellino added a commit to AAROC/invenio that referenced this issue Mar 3, 2015

Update INSTALL
The pkg-config package needs to be installed, else `pip install -r requirements.txt` will fail when installing matplotlib. See matplotlib/matplotlib#3029/ and brucellino/zenodo-docker-role#3
@Altoidnerd

This comment has been minimized.

Show comment
Hide comment
@Altoidnerd

Altoidnerd Mar 7, 2015

Same here... principle error message is

* The following required packages can not be built:

                        * freetype

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-FyyI8J/matplotlib

I tried

apt-get install pkg-config 

but the command return 0 installed/updated and nevertheless didn't solve my problem.
more discussion:

Altoidnerd commented Mar 7, 2015

Same here... principle error message is

* The following required packages can not be built:

                        * freetype

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-FyyI8J/matplotlib

I tried

apt-get install pkg-config 

but the command return 0 installed/updated and nevertheless didn't solve my problem.
more discussion:

@llazzaro

This comment has been minimized.

Show comment
Hide comment
@llazzaro

llazzaro May 16, 2015

Same here with OS X 10.10.3

fixed with

brew install pkg-config

llazzaro commented May 16, 2015

Same here with OS X 10.10.3

fixed with

brew install pkg-config
@tacaswell

This comment has been minimized.

Show comment
Hide comment
@tacaswell

tacaswell May 24, 2015

Member

@llazzaro This is documented in https://github.com/matplotlib/matplotlib/blob/master/README.osx but says to use brew install pkgconfig instead of brew install pkg-config. Do both work or did brew re-name things under us?

attn @jenshnielsen

Member

tacaswell commented May 24, 2015

@llazzaro This is documented in https://github.com/matplotlib/matplotlib/blob/master/README.osx but says to use brew install pkgconfig instead of brew install pkg-config. Do both work or did brew re-name things under us?

attn @jenshnielsen

@jenshnielsen

This comment has been minimized.

Show comment
Hide comment
@jenshnielsen

jenshnielsen May 24, 2015

Member

Both should work. But pkg-config is the correct name and pgkconfig is an alias see https://github.com/Homebrew/homebrew/blob/master/Library/Aliases/pkgconfig

Member

jenshnielsen commented May 24, 2015

Both should work. But pkg-config is the correct name and pgkconfig is an alias see https://github.com/Homebrew/homebrew/blob/master/Library/Aliases/pkgconfig

@cchriste

This comment has been minimized.

Show comment
Hide comment
@cchriste

cchriste Jul 15, 2015

sudo apt-get install pkg-config 

worked for me!

cchriste commented Jul 15, 2015

sudo apt-get install pkg-config 

worked for me!

@khazamov

This comment has been minimized.

Show comment
Hide comment
@khazamov

khazamov Aug 21, 2015

@benesch thanks for the post - it worked. How did you find out what was the reason?

khazamov commented Aug 21, 2015

@benesch thanks for the post - it worked. How did you find out what was the reason?

@benesch

This comment has been minimized.

Show comment
Hide comment
@benesch

benesch Aug 25, 2015

@khazamov it's been a year, but IIRC I went source spelunking and noticed the hardcoded path to the freetype header was incorrect for OS X. Luckily pkg-config is capable of detecting freetype, and matplotlib prefers pkg-config's advice over the hardcoded path.

benesch commented Aug 25, 2015

@khazamov it's been a year, but IIRC I went source spelunking and noticed the hardcoded path to the freetype header was incorrect for OS X. Luckily pkg-config is capable of detecting freetype, and matplotlib prefers pkg-config's advice over the hardcoded path.

@kevinsoucy

This comment has been minimized.

Show comment
Hide comment
@kevinsoucy

kevinsoucy Oct 9, 2015

sudo apt-get install libfreetype6-dev
sudo pip install matplotlib --upgrade

DONE

kevinsoucy commented Oct 9, 2015

sudo apt-get install libfreetype6-dev
sudo pip install matplotlib --upgrade

DONE

@darajer

This comment has been minimized.

Show comment
Hide comment
@darajer

darajer Oct 18, 2015

You solved my life kevinsoucy! Much thanks!

darajer commented Oct 18, 2015

You solved my life kevinsoucy! Much thanks!

@Honghe

This comment has been minimized.

Show comment
Hide comment
@Honghe

Honghe Nov 30, 2015

Ubuntu 14.04 64bit
pip install matplotlib 1.5.
Fixed with sudo apt-get install pkg-config

Honghe commented Nov 30, 2015

Ubuntu 14.04 64bit
pip install matplotlib 1.5.
Fixed with sudo apt-get install pkg-config

@prawn-cake

This comment has been minimized.

Show comment
Hide comment
@prawn-cake

prawn-cake Dec 19, 2015

Faced with the same problem on debian jessie.
Same solution: sudo apt-get install pkg-config

prawn-cake commented Dec 19, 2015

Faced with the same problem on debian jessie.
Same solution: sudo apt-get install pkg-config

@mvnnn

This comment has been minimized.

Show comment
Hide comment
@mvnnn

mvnnn Jan 9, 2016

LinuxMint 17 64bit
i try: sudo apt-get install pkg-config
but still i get error while run : pip install matplotlib

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-kyfoezji/matplotlib

mvnnn commented Jan 9, 2016

LinuxMint 17 64bit
i try: sudo apt-get install pkg-config
but still i get error while run : pip install matplotlib

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-kyfoezji/matplotlib
@jenshnielsen

This comment has been minimized.

Show comment
Hide comment
@jenshnielsen

jenshnielsen Jan 9, 2016

Member

Could you try doing pip install matplotlib --verbose It is by no means clear from that error message that your issue in any way relates to package config.

Member

jenshnielsen commented Jan 9, 2016

Could you try doing pip install matplotlib --verbose It is by no means clear from that error message that your issue in any way relates to package config.

@mvnnn

This comment has been minimized.

Show comment
Hide comment
@mvnnn

mvnnn Jan 9, 2016

thanks, it's working now.

mvnnn commented Jan 9, 2016

thanks, it's working now.

@jianqi

This comment has been minimized.

Show comment
Hide comment
@jianqi

jianqi Jan 24, 2016

same here.. faced the error will installing v1.5.1 on ubuntu 14.04

fixed with installing pkg-config

jianqi commented Jan 24, 2016

same here.. faced the error will installing v1.5.1 on ubuntu 14.04

fixed with installing pkg-config

@ameyp

This comment has been minimized.

Show comment
Hide comment
@ameyp

ameyp Feb 2, 2016

Is it possible to have the error say "pkg-config: not found" instead of complaining about freetype?

ameyp commented Feb 2, 2016

Is it possible to have the error say "pkg-config: not found" instead of complaining about freetype?

@julianofischer

This comment has been minimized.

Show comment
Hide comment
@julianofischer

julianofischer Feb 27, 2016

Thank you.

sudo apt-get install pkg-config

Worked for me!

I agree with @ameyp

julianofischer commented Feb 27, 2016

Thank you.

sudo apt-get install pkg-config

Worked for me!

I agree with @ameyp

@scott-vsi

This comment has been minimized.

Show comment
Hide comment
@scott-vsi

scott-vsi Mar 1, 2016

Contributor

+1 Please suggest installing pkg-config.

Contributor

scott-vsi commented Mar 1, 2016

+1 Please suggest installing pkg-config.

@tacaswell

This comment has been minimized.

Show comment
Hide comment
@ameyp

This comment has been minimized.

Show comment
Hide comment
@ameyp

ameyp Mar 2, 2016

@tacaswell Does the installation work on most systems without pkg-config installed? The headers are at the location specified in the dpkg package, so I wouldn't exactly say that they're in a non-standard location.

ameyp commented Mar 2, 2016

@tacaswell Does the installation work on most systems without pkg-config installed? The headers are at the location specified in the dpkg package, so I wouldn't exactly say that they're in a non-standard location.

@tacaswell

This comment has been minimized.

Show comment
Hide comment
@tacaswell

tacaswell Mar 2, 2016

Member

Not sure. We have talked about moving pkg-config to the required section.

Member

tacaswell commented Mar 2, 2016

Not sure. We have talked about moving pkg-config to the required section.

@scott-vsi

This comment has been minimized.

Show comment
Hide comment
@scott-vsi

scott-vsi Mar 2, 2016

Contributor

Thanks for the link. If the installation script can't suggest installing pkg-config (if it is not installed) when failing to find freetype then perhaps the documentation could suggest this.

E.g., in the Building on Linux you could add a note like

If the freetype developer package is installed by the system package manager but not found when installing matplotlib, try installing pkg-config, a tool used to find required non-python libraries.

Contributor

scott-vsi commented Mar 2, 2016

Thanks for the link. If the installation script can't suggest installing pkg-config (if it is not installed) when failing to find freetype then perhaps the documentation could suggest this.

E.g., in the Building on Linux you could add a note like

If the freetype developer package is installed by the system package manager but not found when installing matplotlib, try installing pkg-config, a tool used to find required non-python libraries.

@tacaswell

This comment has been minimized.

Show comment
Hide comment
@tacaswell

tacaswell Mar 2, 2016

Member

@scott-vsi Can you put in a Pull request adding that text where you would expect to have found it?

Member

tacaswell commented Mar 2, 2016

@scott-vsi Can you put in a Pull request adding that text where you would expect to have found it?

@ameyp

This comment has been minimized.

Show comment
Hide comment
@ameyp

ameyp Mar 2, 2016

@tacaswell I would really prefer having the installation script check for pkg-config instead. I can try to put in a PR for that if you'd like. I believe most users would try to install matplotlib via either pip or the system package manager, encounter the error, google for the error and then end up here. Having the installation check for pkg-config seems like a cleaner solution to me.

ameyp commented Mar 2, 2016

@tacaswell I would really prefer having the installation script check for pkg-config instead. I can try to put in a PR for that if you'd like. I believe most users would try to install matplotlib via either pip or the system package manager, encounter the error, google for the error and then end up here. Having the installation check for pkg-config seems like a cleaner solution to me.

@scott-vsi

This comment has been minimized.

Show comment
Hide comment
@scott-vsi

scott-vsi Mar 2, 2016

Contributor

I agree that is better. I did a pull request for the interim if you want.

Contributor

scott-vsi commented Mar 2, 2016

I agree that is better. I did a pull request for the interim if you want.

@saukymo

This comment has been minimized.

Show comment
Hide comment
@saukymo

saukymo Mar 17, 2016

sudo apt-get install pkg-config
works for me

saukymo commented Mar 17, 2016

sudo apt-get install pkg-config
works for me

@calebebrim

This comment has been minimized.

Show comment
Hide comment
@calebebrim

calebebrim Apr 1, 2016

brew install pkgconfig
I'm getting:
Warning: pkg-config-0.28 already installed

But i still can't install matplotlib

More about this issue: http://stackoverflow.com/questions/36341660/python-pip-install-exception-matplotlib

Should I open a new issue ?

calebebrim commented Apr 1, 2016

brew install pkgconfig
I'm getting:
Warning: pkg-config-0.28 already installed

But i still can't install matplotlib

More about this issue: http://stackoverflow.com/questions/36341660/python-pip-install-exception-matplotlib

Should I open a new issue ?

@jenshnielsen

This comment has been minimized.

Show comment
Hide comment
@jenshnielsen

jenshnielsen Apr 1, 2016

Member

@calebebrim Did you actually install freetype?

brew install freetype

Freetype is a dependency of matplotlib and needs to be installed for matplotlib to build. pkg-config only helps locate it.

Member

jenshnielsen commented Apr 1, 2016

@calebebrim Did you actually install freetype?

brew install freetype

Freetype is a dependency of matplotlib and needs to be installed for matplotlib to build. pkg-config only helps locate it.

omsai added a commit to omsai/poretools that referenced this issue Jun 11, 2016

Update Ubuntu dependencies for matplotlib-2.0.0b1 #84
- libfreetype6-dev satisfies the freetype requirement.

- pkg-config addresses freetype detection by matplotlib (see
  matplotlib/matplotlib#3029).
@janssen

This comment has been minimized.

Show comment
Hide comment
@janssen

janssen 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

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 commented 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

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.

@tacaswell

This comment has been minimized.

Show comment
Hide comment
@tacaswell

tacaswell Jun 17, 2016

Member

@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).

Member

tacaswell commented 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

This comment has been minimized.

Show comment
Hide comment
@kubark42

kubark42 Jun 24, 2016

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.

kubark42 commented Jun 24, 2016

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.

@Turing-Chu

This comment has been minimized.

Show comment
Hide comment
@Turing-Chu

Turing-Chu 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:

/Users/XXXX/Downloads/freetype-2.6/devel/ft2build.h
/Users/XXXX/Downloads/freetype-2.6/include/ft2build.h
/Users/XXXX/Downloads/matplotlib-1.5.1/src/ft2build.h
/usr/local/apps/freetype-2.6/include/freetype2/ft2build.h
/usr/local/include/freetype2/ft2build.h

Turing-Chu commented 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:

/Users/XXXX/Downloads/freetype-2.6/devel/ft2build.h
/Users/XXXX/Downloads/freetype-2.6/include/ft2build.h
/Users/XXXX/Downloads/matplotlib-1.5.1/src/ft2build.h
/usr/local/apps/freetype-2.6/include/freetype2/ft2build.h
/usr/local/include/freetype2/ft2build.h
@cfblaeb

This comment has been minimized.

Show comment
Hide comment
@cfblaeb

cfblaeb 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/

cfblaeb commented 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/

@feikname feikname referenced this issue Dec 11, 2016

Merged

FreeType2 font renderer #484

1 of 1 task complete
@iacchus

This comment has been minimized.

Show comment
Hide comment
@iacchus

iacchus Jan 5, 2017

OPTIONAL PACKAGE DATA
                  dlls: no  [skipping due to configuration]

============================================================================
                        * The following required packages can not be built:
                        * freetype

Then

sudo apt-get install libfreetype6-dev
sudo pip install matplotlib --upgrade

DONE

Which, by the way, is exactly the only error that the output is clearly saying.

iacchus commented Jan 5, 2017

OPTIONAL PACKAGE DATA
                  dlls: no  [skipping due to configuration]

============================================================================
                        * The following required packages can not be built:
                        * freetype

Then

sudo apt-get install libfreetype6-dev
sudo pip install matplotlib --upgrade

DONE

Which, by the way, is exactly the only error that the output is clearly saying.

@OnlyBelter

This comment has been minimized.

Show comment
Hide comment
@OnlyBelter

OnlyBelter Dec 25, 2017

If you are using docker, and install matplotlib in python:3.5-alpine, add this in your Dockerfile may hlep:

RUN set -e; \
        apk add --no-cache --virtual .build-deps \
                gcc \
                libc-dev \
                linux-headers \
                mariadb-dev \
                python3-dev \
                postgresql-dev \
                freetype-dev \
                libpng-dev \
                libxml2-dev \
                libxslt-dev \
                zlib-dev \
        ;

OnlyBelter commented Dec 25, 2017

If you are using docker, and install matplotlib in python:3.5-alpine, add this in your Dockerfile may hlep:

RUN set -e; \
        apk add --no-cache --virtual .build-deps \
                gcc \
                libc-dev \
                linux-headers \
                mariadb-dev \
                python3-dev \
                postgresql-dev \
                freetype-dev \
                libpng-dev \
                libxml2-dev \
                libxslt-dev \
                zlib-dev \
        ;
@z-pc

This comment has been minimized.

Show comment
Hide comment
@z-pc

z-pc Jan 12, 2018

If you're installing matplotlib in windows.
Then try:

  1. Modify setupext.py:
    1.1 Follow def get_base_dirs():
    1.2. "Try" replace win_bases = ['win32_static', ] -> win_bases = ['C:\Program Files\Anaconda2\Library', ]
  2. 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

z-pc commented Jan 12, 2018

If you're installing matplotlib in windows.
Then try:

  1. Modify setupext.py:
    1.1 Follow def get_base_dirs():
    1.2. "Try" replace win_bases = ['win32_static', ] -> win_bases = ['C:\Program Files\Anaconda2\Library', ]
  2. 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment