python安装matplotlib模块出错,python – 安装matplotlib时出错

我试过使用pip install matplotlib和git clone然后python setup.py安装,如

the installation faq中描述的Mac OS 10.7。但我得到相同的错误:

[...]

llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -I. -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/freetype2 -I./freetype2 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/ft2font.cpp -o build/temp.macosx-10.7-intel-2.7/src/ft2font.o

cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++

In file included from src/ft2font.cpp:3:

src/ft2font.h:16:22: error: ft2build.h: No such file or directory

src/ft2font.h:17:10: error: #include expects "FILENAME" or

src/ft2font.h:18:10: error: #include expects "FILENAME" or

src/ft2font.h:19:10: error: #include expects "FILENAME" or

src/ft2font.h:20:10: error: #include expects "FILENAME" or

src/ft2font.h:21:10: error: #include expects "FILENAME" or

In file included from src/ft2font.cpp:3:

src/ft2font.h:34: error: ‘FT_Bitmap’ has not been declared

src/ft2font.h:34: error: ‘FT_Int’ has not been declared

src/ft2font.h:34: error: ‘FT_Int’ has not been declared

src/ft2font.h:86: error: expected ‘,’ or ‘...’ before ‘&’ token

[...]

似乎我错过了一些软件包安装在我的系统中?或者有任何其他更好的方法来安装matplotlib?

谢谢!

更新:通过谷歌和搜索我发现我可能缺乏包freetype2,但是,如果我尝试安装它通过homebrew我得到一个警告消息:

[me @ my mac]$ brew search freetype

Apple distributes freetype with OS X, you can find it in /usr/X11/lib.

However not all build scripts look here, so you may need to call ENV.x11

in your formula's install function.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值