在Mac OSX Mountain Lion上安装matplotlib

时间:2012-08-31 19:31:08

标签: python macos matplotlib

我正在尝试安装matplotlib但遇到很多问题。我从pip install matplotlib收到一个常见错误,并尝试从源代码构建:

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

必需的依赖

             numpy: 1.6.1

                    * Could not find the headers for numpy.  You may

                    * need to install the development package.
编辑:终于解决了。我需要安装gfortran和gcc编译器。它是否使用brew,一切都像魅力一样!

4 个答案:

答案 0 :(得分:4)

在Mountain Lion上安装matplotlib需要安装matplotlib的开发版本。

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

您可能需要numpy 1.6.2才能使用。

一般来说,对于Mountain Lion,你可以找到很好的建议和一个很好描述的逐步程序来在this link安装numpy / scipy / matplotlib / IPhython

答案 1 :(得分:2)

终于解决了。我需要安装gfortran和gcc编译器。它是否使用brew,一切都像魅力一样!

答案 2 :(得分:0)

macports或brew是mac上最好的方式。我的经验

答案 3 :(得分:-1)

安装numpy。

pip install numpy

它应该为你排序依赖 - 我不知道为什么它不起作用。

相关问题