我使用Mac OSX Sierra,并尝试在matplotlib
中安装python 3.7
,因此使用
pip3.7 install matplotlib
但这给我一个错误
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/include -I/usr/include -I/usr/X11/include -I/opt/X11/include -I/opt/local/include -I. -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/_macosx.m -o build/temp.macosx-10.11-x86_64-3.7/src/_macosx.o
In file included from src/_macosx.m:1:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:6:
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:7:15: error: expected ';' after @class
@class NSArray<ObjectType>;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:7:16: error: cannot find protocol declaration for 'ObjectType'
@class NSArray<ObjectType>;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:34:25: error: cannot find protocol declaration for 'ObjectType'
@interface NSEnumerator<ObjectType> : NSObject <NSFastEnumeration>
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:34:37: error: expected identifier or '('
@interface NSEnumerator<ObjectType> : NSObject <NSFastEnumeration>
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:36:13: error: expected ')'
- (nullable ObjectType)nextObject;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:36:3: note: to match this '('
- (nullable ObjectType)nextObject;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:40:25: error: cannot find protocol declaration for 'ObjectType'
@interface NSEnumerator<ObjectType> (NSExtendedEnumerator)
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:40:1: error: duplicate interface definition for class 'NSEnumerator'
@interface NSEnumerator<ObjectType> (NSExtendedEnumerator)
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:34:12: note: previous definition is here
@interface NSEnumerator<ObjectType> : NSObject <NSFastEnumeration>
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:40:37: error: method type specifier must start with '-' or '+'
@interface NSEnumerator<ObjectType> (NSExtendedEnumerator)
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:40:38: error: expected a type
@interface NSEnumerator<ObjectType> (NSExtendedEnumerator)
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:42:1: error: expected selector for Objective-C method
@property (readonly, copy) NSArray<ObjectType> *allObjects;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSEnumerator.h:42:36: error: cannot find protocol declaration for 'ObjectType'
@property (readonly, copy) NSArray<ObjectType> *allObjects;
^
In file included from src/_macosx.m:1:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10:
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:16:32: error: cannot find protocol declaration for 'ObjectType'
@interface NSArray<__covariant ObjectType> : NSObject <NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration>
^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:16:44: error: expected identifier or '('
@interface NSArray<__covariant ObjectType> : NSObject <NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration>
^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:19:4: error: expected a type
- (ObjectType)objectAtIndex:(NSUInteger)index;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:21:40: error: expected ')'
- (instancetype)initWithObjects:(const ObjectType [])objects count:(NSUInteger)cnt NS_DESIGNATED_INITIALIZER;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:21:33: note: to match this '('
- (instancetype)initWithObjects:(const ObjectType [])objects count:(NSUInteger)cnt NS_DESIGNATED_INITIALIZER;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:26:20: error: cannot find protocol declaration for 'ObjectType'
@interface NSArray<ObjectType> (NSExtendedArray)
^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:26:1: error: duplicate interface definition for class 'NSArray'
@interface NSArray<ObjectType> (NSExtendedArray)
^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:16:12: note: previous definition is here
@interface NSArray<__covariant ObjectType> : NSObject <NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration>
^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:26:32: error: method type specifier must start with '-' or '+'
@interface NSArray<ObjectType> (NSExtendedArray)
^
/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:26:33: error: expected a type
@interface NSArray<ObjectType> (NSExtendedArray)
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
error: command 'clang' failed with exit status 1
----------------------------------------
Failed building wheel for matplotlib
任何有关解决此问题的建议将不胜感激。