0

I'm currently using matplotlib 1.0.1, running with Python 2.7.1, but like to update it to at least 1.1.0. However, when I tried downloading matplotlib-1.1.0-py2.7-python.org-macosx10.3.dmg from

http://sourceforge.net/projects/matplotlib/files/matplotlib/,

the subsequent installation states "matplotlib 1.1.0 can't be installed on this disk. matplotlib requires System Python 2.7 to install."

Alternatively, I tried $easy_install matplotlib in the terminal and got the following output:

install_dir /Library/Frameworks/Python.framework/Versions/7.0/lib/python2.7/site-packages/ Searching for matplotlib Best match: matplotlib 1.0.1 Adding matplotlib 1.0.1 to easy-install.pth file

Using /Library/Frameworks/Python.framework/Versions/7.0/lib/python2.7/site-packages Processing dependencies for matplotlib Finished processing dependencies for matplotlib

And $easy_install upgrade matplotlib got the following errors:

BUILDING MATPLOTLIB matplotlib: 1.1.0 python: 2.7.1 |EPD 7.0-2 (32-bit)| (r271:86832, Dec 3 2010, 15:41:32) [GCC 4.0.1 (Apple Inc. build 5488)] platform: darwin

REQUIRED DEPENDENCIES numpy: 1.5.1 freetype2: found, but unknown version (no pkg-config) * WARNING: Could not find 'freetype2' headers in any * of '.', './freetype2'.

OPTIONAL BACKEND DEPENDENCIES libpng: found, but unknown version (no pkg-config) * Could not find 'libpng' headers in any of '.' Tkinter: Tkinter: 81008, Tk: 8.4, Tcl: 8.4 Gtk+: no * Building for Gtk+ requires pygtk; you must be able * to "import gtk" in your build/install environment Mac OS X native: yes Qt: no Qt4: no Cairo: no

OPTIONAL DATE/TIMEZONE DEPENDENCIES datetime: present, version unknown dateutil: 1.5 pytz: 2010o

OPTIONAL USETEX DEPENDENCIES dvipng: 1.13 ghostscript: 8.71 latex: 3.1415926

[Edit setup.cfg to suppress the above messages] ============================================================================ 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'] 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' In file included from src/ft2font.h:16, from src/ft2font.cpp:3: /Library/Frameworks/Python.framework/Versions/7.0/include/ft2build.h:56:38: error: freetype/config/ftheader.h: No such file or directory In file included from src/ft2font.cpp:3: src/ft2font.h:17:10: error: #include expects "FILENAME" or src/ft2font.h:18:10: error: #include expects "FILENAME" or src/ft2font.h:19:10: error: #include expects "FILENAME" or src/ft2font.h:20:10: error: #include expects "FILENAME" or src/ft2font.h:21:10: error: #include expects "FILENAME" or In file included from src/ft2font.cpp:3: src/ft2font.h:35: error: ‘FT_Bitmap’ has not been declared src/ft2font.h:35: error: ‘FT_Int’ has not been declared src/ft2font.h:35: error: ‘FT_Int’ has not been declared src/ft2font.h:91: error: expected ‘,’ or ‘...’ before ‘&’ token src/ft2font.h:91: error: ISO C++ forbids declaration of ‘FT_Face’ with no type src/ft2font.h:138: error: ‘FT_Face’ does not name a type src/ft2font.h:139: error: ‘FT_Matrix’ does not name a type src/ft2font.h:140: error: ‘FT_Vector’ does not name a type src/ft2font.h:141: error: ‘FT_Error’ does not name a type src/ft2font.h:142: error: ‘FT_Glyph’ was not declared in this scope src/ft2font.h:142: error: template argument 1 is invalid src/ft2font.h:142: error: template argument 2 is invalid src/ft2font.h:143: error: ‘FT_Vector’ was not declared in this scope src/ft2font.h:143: error: template argument 1 is invalid src/ft2font.h:143: error: template argument 2 is invalid src/ft2font.h:149: error: ‘FT_BBox’ does not name a type src/ft2font.cpp:51: error: ‘FT_Library’ does not name a type src/ft2font.cpp:114: error: variable or field ‘draw_bitmap’ declared void src/ft2font.cpp:114: error: ‘FT_Bitmap’ was not declared in this scope src/ft2font.cpp:114: error: ‘bitmap’ was not declared in this scope src/ft2font.cpp:115: error: ‘FT_Int’ was not declared in this scope src/ft2font.cpp:116: error: ‘FT_Int’ was not declared in this scope error: Setup script exited with error: command 'gcc' failed with exit status 1

Sorry if this problem is too elementary, but I just can't figure out where the error might be. Thank you for your help!

neither-nor
  • 1,125
  • 2
  • 13
  • 25
  • 1
    Although you can use a package manager like MacPorts or homebrew to install matplotlib on OS X, if you are interested in a method that uses only the XCode-provided freetype and libpng libraries, see my answer to a related question [here](http://stackoverflow.com/a/10843478/781673). – mhowison Jun 01 '12 at 02:09

2 Answers2

0

Try using pypi!

There is already matplotlib 1.1 http://pypi.python.org/pypi/matplotlib/1.1.0

przemo_li
  • 3,703
  • 3
  • 31
  • 52
0

If you use x64 OS X version (Snow Leopard or Lion) just download this one.

SkyFox
  • 1,607
  • 3
  • 19
  • 30
  • Error message includes: "Could not find 'libpng' headers in any of '.'". Updage libpng with easy_install before updating matplotlib. – SkyFox Apr 11 '12 at 07:53
  • Upgraded it but got the exact same error messages, even the one you quoted. – neither-nor Apr 11 '12 at 08:42
  • Did that and it seems to work: `---> Installing py27-matplotlib @1.1.0_0+tkinter ---> Activating py27-matplotlib @1.1.0_0+tkinter` However, when I went back into ipython and checked matplotlib.__version__, it returned '1.0.1'. Do you know where port install might have placed the '1.1.0' in? Once I find it, should I move that to replace the current matplotlib dir that is in: /Library/Frameworks/Python.framework/Versions/7.0/lib/python2.7/site-packages ? – neither-nor Apr 11 '12 at 22:58