2013-10-16 146 views
0

所以我一直試圖在Mac OS X 10.8上安裝matplotlib和numpy兩天。只是似乎無法讓他們運轉起來。我得到各種各樣的錯誤。我終於設法安裝numpy的1.5,那麼當我安裝matplotlib與「PIP安裝matplotlib == 1.0.1」,我以後通過安裝一些進展得到一個錯誤:這是錯誤的最後一部分:在OS X上安裝Numpy和matplotlib 10.8.5

gcc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -I. -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -Isrc -Iagg24/include -I. -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -I/opt/local/include/freetype2 -I/opt/local/include -I. -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c CXX/IndirectPythonInterface.cxx -o build/temp.macosx-10.5-intel-2.7/CXX/IndirectPythonInterface.o 

gcc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -I. -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -Isrc -Iagg24/include -I. -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -I/opt/local/include/freetype2 -I/opt/local/include -I. -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c CXX/cxxextensions.c -o build/temp.macosx-10.5-intel-2.7/CXX/cxxextensions.o 

gcc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -I. -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -Isrc -Iagg24/include -I. -I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include -I/opt/local/include/freetype2 -I/opt/local/include -I. -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/backend_agg.cpp -o build/temp.macosx-10.5-intel-2.7/src/backend_agg.o 

In file included from src/backend_agg.cpp:9: 

In file included from src/_backend_agg.h:32: 

agg24/include/agg_renderer_outline_aa.h:1368:45: error: binding of reference to type 'agg::line_profile_aa' to a value of type 'const agg::line_profile_aa' drops qualifiers 

     line_profile_aa& profile() { return *m_profile; } 

              ^~~~~~~~~~ 

1 error generated. 

error: command 'gcc' failed with exit status 1 

當我在終端中鍵入「gcc」時,它運行良好。我安裝了XCode 5和命令行工具。有誰知道如何解決這一問題?

+0

您是否嘗試過使用包管理器,如[macports](https://www.macports.org/)或[homebrew](http://brew.sh/)? – askewchan

回答

0

另一個(更簡單)選項比雨棚和蟒蛇,只是下載Spyder的dmg,附帶了與NumPy,SciPy的,matplotlib,熊貓,Sympy和sci-的最新版本套件。這是一個純粹的拖放安裝程序(如Firefox或Chrome)。

0

節省自己的痛苦,只需安裝Enthought Canopy。它將安裝完整的SciPy stack(其中包括NumPy和MatPlotLib)以及許多其他有用的軟件包(包括IPython,這太棒了!)。

編碼愉快:)

+0

或[anaconda](https://store.continuum.io/cshop/anaconda/) – askewchan

+1

@askewchan Anaconda很好,但他們[收費](https://store.continuum.io/cshop/mkl-optimizations /)用於MKL優化,這是Canopy免費版本[包含](https://www.enthought.com/products/canopy/package-index/)。 –