Matplotlib installation errors - clang

I tried installing Matplot lib, but I am still struggling to get past the errors.

I installed numpy and psipy, but have the following error when I use easy_install (there is a similar error with pip).

And yes, I installed the command line tools in Xcode in an attempt to solve the "gcc-4.2 not found" problem.

pymods ['pylab'] packages ['matplotlib', 'matplotlib.backends', 'matplotlib.backends.qt4_editor', 'matplotlib.projections', 'matplotlib.testing', 'matplotlib.testing.jpl_units', 'matplotlib.tests', 'mpl_toolkits', 'mpl_toolkits.mplot3d', 'mpl_toolkits.axes_grid', 'mpl_toolkits.axes_grid1', 'mpl_toolkits.axisartist', 'matplotlib.sphinxext', 'matplotlib.tri', 'matplotlib.delaunay', 'pytz', 'dateutil', 'dateutil.zoneinfo'] warning: no files found matching 'KNOWN_BUGS' warning: no files found matching 'INTERACTIVE' warning: no files found matching 'MANIFEST' warning: no files found matching '__init__.py' warning: no files found matching 'examples/data/*' warning: no files found matching 'lib/mpl_toolkits' warning: no files found matching 'LICENSE*' under directory 'license' gcc-4.2 not found, using clang instead In file included from src/ft2font.cpp:3: src/ft2font.h:16:10: fatal error: 'ft2build.h' file not found #include <ft2build.h> ^ 1 error generated. error: Setup script exited with error: command 'clang' failed with exit status 1 
+4
source share
3 answers

I recently had this problem, but I used pip. If you have homebrew installed, you can solve it by running the following commands:

 brew install freetype brew install libpng brew link freetype pip install git+https://github.com/matplotlib/matplotlib.git#egg=matplotlib-dev 
+8
source

theres actually an easier way! First see if the X11 libraries are installed (ls / usr / X11 / include)

If this is not the case, you may need to install X11

If this is then a simple fix, this is:

 cd /usr/X11/include sudo ln -s freetype2/freetype 

For some reason, he is looking for the freetype library in / usr / X 11 and it is actually in a subfolder of freetype2. Odd - but then it compiles in this way.

+3
source

You are missing freetype2 or at least the development version. He is looking for ft2build.h , which is the freetype2 header file.

You can either install freetype2 from the source, or just a package manager such as macports, fink or homebrew to install it (for package managers, make sure you select the development version, if any).

But if you follow the path of package managers, you can also install matplotlib this way. And there may be binaries for OS X that include freetype2, so it can be even simpler than installing from the source.

The reason easy_install and pip does not install freetype2 for you, it is not a Python package.

== Correction ==

freetype2 should be available, not just where easy_install or pip is expecting it. On my Mac, I can ft2build.h in / usr / X 11 / include. Thus, you need to set the CFLAGS variable to this directory (and probably LDFLAGS in / usr / X 11 / lib`) to make the installation work. Now, with easy_install and pip, I am not 100% sure how to do this. Try for example

 CFLAGS=-I/usr/X11/include LDFLAGS=-L/usr/X11/lib easy_install matplotlib 

Or just download the matplotlib source, configure setup.py and create it yourself.

0
source

Source: https://habr.com/ru/post/1439986/


All Articles