0

所以我已经连续两天尝试在我的 Mac OS X 10.8 上安装 matplotlib 和 numpy。只是似乎无法让它们启动并运行。我得到各种各样的错误。我终于设法安装了 numpy 1.5,然后当我使用“pip install matplotlib==1.0.1”安装 matplotlib 时,在安装取得一些进展后出现错误:这是错误的最后一部分:

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 和命令行工具。有谁知道如何解决这一问题?

4

2 回答 2

0

省去自己的痛苦,只需安装Enthought Canopy即可。它将安装完整的SciPy 堆栈(包括 NumPy 和 MatPlotLib)以及许多其他有用的包(包括IPython,太棒了!)。

快乐编码:)

于 2013-10-16T03:15:18.133 回答
0

与 Canopy 和 Anaconda 相比,另一个(甚至更简单)的选择就是下载 Spyder 的dmg,它附带最新版本的 Numpy、SciPy、matplotlib、Pandas、Sympy 和 sci-kits。这是一个纯粹的拖放安装程序(如 Firefox 或 Chrome 的)。

于 2013-10-16T04:09:26.050 回答