2012-08-31 74 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上。我的經驗