Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing matplotlib on Mac OSX Mountain Lion

I am trying to install matplotlib but facing many problems. I am receiving a common error from both pip install matplotlib as well as trying to build from source which is:

BUILDING MATPLOTLIB

        matplotlib: 1.1.1

            python: 2.7.2 (default, Jun 20 2012, 16:23:33)  [GCC 4.2.1

                    Compatible Apple Clang 4.0

                    (tags/Apple/clang-418.0.60)]

          platform: darwin

REQUIRED DEPENDENCIES

             numpy: 1.6.1

                    * Could not find the headers for numpy.  You may

                    * need to install the development package.

EDIT: Solved it finally. I needed to install gfortran and gcc compilers. Did it using brew and everything worked like a charm!

like image 514
Amitash Avatar asked Aug 31 '12 19:08

Amitash


2 Answers

Installing matplotlib on Mountain Lion requires to install the development version of matplotlib.

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

You may need numpy 1.6.2 for it to work.

Generally, for Mountain Lion, you can find great advices and a well described step-by-step procedure to install numpy/scipy/matplotlib/IPhython at this link

like image 161
gcalmettes Avatar answered Oct 29 '22 18:10

gcalmettes


Solved it finally. I needed to install gfortran and gcc compilers. Did it using brew and everything worked like a charm!

like image 42
Amitash Avatar answered Oct 29 '22 16:10

Amitash