2012-08-31 224 views
5

我试图安装matplotlib,但面临很多问题。我收到一个常见的错误来自两个点子安装matplotlib以及试图从源代码这是构建:在Mac OSX上安装matplotlib Mountain Lion

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编译器。它使用酿造和一切都像魅力工作!

+0

从源码建设应该没问题(至少从git最近的版本)。但是你需要确保numpy的头文件在链接器路径中。 – tiago

回答

2

终于解决了。我需要安装gfortran和gcc编译器。它使用酿造和一切都像魅力工作!

+1

你是如何安装gcc和fortran的?我在酿造中发现了gfortran,但不是gcc?另外,你之后是否直接安装了matplotlib,或者你是否需要'pip install --upgrade numpy'first? – metakermit

+0

@ kermit666它在那里酿造 – Peter

+0

谢谢,@Peter。也许一年太晚了,但:)这是我的工作教程:http://www.thisisthegreenroom.com/2011/installing-python-numpy-scipy-matplotlib-and-ipython-on-lion/ – metakermit

-1

安装numpy。

pip install numpy 

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

+0

我已经有numpy 1.6.1 – Amitash

+0

你用pip安装了吗? –

+0

我已经有numpy了。无论如何,我再次尝试它,并表示要求得到满足。刚试过numpy – Amitash

4

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

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

您可能需要numpy 1.6.2为它工作。

一般来说,对于山狮,你可以找到伟大的意见和很好的描述一步一步的步骤安装numpy的/ SciPy的/ matplotlib/IPhython在this link

+1

您可能想要将其固定到可在mac上运行的最新标记:'git + git://github.com/matplotlib/[email protected] @ egg = matplotlib'' – jterrace

0

的MacPorts或BREW是这样的事情的最好方法在mac上。我的经验

相关问题