Installing (building) matplotlib on mac osx lion

I installed pynum and scipy (on osx Lion with python 2.7), but when I tried to build matplotlib

git clone https://github.com/matplotlib/matplotlib.git cd matplotlib python setup.py build python setup.py install 

I have these errors:

 /System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSTypes.h:242: error: declaration for parameter 'FMFontDirectoryFilter' but no such parameter src/_macosx.m:5912: error: expected '{' at end of input lipo: can't open input file: /var/folders/qw/pr2f7vq91b3c3ngkxrrqplm8zkv09r/T//ccAgEklo.out (No such file or directory) error: command 'llvm-gcc-4.2' failed with exit status 1 

Can someone please tell me what is the problem?

PS First I tried to install it like this:

 pip install -e git+https://github.com/matplotlib/matplotlib#egg=matplotlib-dev 

but it did not work for me

+5
source share
1 answer

I always find this process more painful than necessary, but I have done this several times, and I believe that these steps should be configured:

  • Get Xcode 4.3.2, it is necessary for some next steps.
  • Download latest python for OSX from python.org
  • Take a Scipy superpack .
  • Uninstall all previous versions of numpy / matplotlib / scipy that you have. This includes running cd /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ and moving any numpy / matplotlib / scipy directories or eggs to the temp directory.
  • cd ~/Downloads (or wherever you downloaded the superpack script in) and run sh install_superpack.sh . Answer the question are you installing from a repository cloned to this machine or you will be confused about why the script continues to fail.

It should be! Now you can load the python console and import numpy, scipy, matplotlib .

+14
source

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


All Articles