【问题标题】:Matplotlib installation on Mavericks在 Mavericks 上安装 Matplotlib
【发布时间】:2014-10-31 06:20:48
【问题描述】:

我在安装 matplotlib 时遇到问题。我正在使用 Mavericks,它抱怨通过 pip 安装和从源代码安装(按照此处 https://github.com/matplotlib/matplotlib/blob/master/README.osx 的说明)已弃用的 NumPy API:

In file included from src/_macosx.m:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:5:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:76:1: error: 
  duplicate interface definition for class 'NSObject'
@interface NSObject <NSObject> {
^
/usr/include/objc/NSObject.h:50:12: note: previous definition is here
@interface NSObject <NSObject> {
       ^
In file included from src/_macosx.m:5:
In file included from /Users/se7entyse7en/Envs/datascience/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4:
In file included from /Users/se7entyse7en/Envs/datascience/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17:
In file included from /Users/se7entyse7en/Envs/datascience/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1761:
/Users/se7entyse7en/Envs/datascience/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: 
  "Using deprecated NumPy API, disable it by "          "#defining NPY_NO_DEPRECATED_API
  NPY_1_7_API_VERSION" [-W#warnings]
#warning "Using deprecated NumPy API, disable it by " \
 ^
1 warning and 1 error generated.
error: command 'clang' failed with exit status 1

之后它在没有完成安装的情况下存在。我已经使用brew 安装了libpngfreetype,并且我也已经通过pip 安装了NumPySciPy

numpy==1.8.2
scipy==0.14.0

【问题讨论】:

  • 你只发布了警告,我不会担心那个具体的警告。请发布错误
  • 我编辑了问题。
  • 谷歌是你的朋友。你试过this吗?
  • @flebool 我该如何解决这个问题?
  • 你注意到我给你发了一个链接吗?

标签: python numpy matplotlib installation osx-mavericks


【解决方案1】:

好的,感谢flebool,我也解决了这个问题。在文件夹中

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs

我同时拥有MacOSX10.9.sdkMacOSX10.8.sdk,但我不知道它们是否应该同时存在。我有小牛队,所以我认为MacOSX10.8.sdk 可能是问题所在。我删除了它,并成功地从源代码安装了matplotlib

【讨论】:

    猜你喜欢
    • 2014-12-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-28
    • 2014-04-15
    • 1970-01-01
    • 2015-03-26
    相关资源
    最近更新 更多