我目前正在尝试使用Xcode 4.6.3在Lion OSX 10.7.5上的Python 2.7中安装“pyobjc”模块。我最终想要安装的模块是Quartz。我尝试了各种安装方法,包括easy_install
,pip install
和python setup.py install
,这些方法都会产生类似的错误消息,如下所示:
1)easy_install
$ easy_install -U pyobjc
Searching for pyobjc
Reading https://pypi.python.org/simple/pyobjc/
Best match: pyobjc 3.0.4
Processing pyobjc-3.0.4-py2.7.egg
pyobjc 3.0.4 is already the active version in easy-install.pth
Using /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyobjc-3.0.4-py2.7.egg
Processing dependencies for pyobjc
Searching for pyobjc-framework-StoreKit==3.0.4
Reading https://pypi.python.org/simple/pyobjc-framework-StoreKit/
Best match: pyobjc-framework-StoreKit 3.0.4
Downloading https://pypi.python.org/packages/source/p/pyobjc-framework-StoreKit/pyobjc-framework-StoreKit-3.0.4.tar.gz#md5=734893300a3aa40153b8fce93e006812
Processing pyobjc-framework-StoreKit-3.0.4.tar.gz
Writing /var/folders/1s/520_dbbj7r9fhx093c93_jf80000gn/T/easy_install-u2q6Sz/pyobjc-framework-StoreKit-3.0.4/setup.cfg
Running pyobjc-framework-StoreKit-3.0.4/setup.py -q bdist_egg --dist-dir /var/folders/1s/520_dbbj7r9fhx093c93_jf80000gn/T/easy_install-u2q6Sz/pyobjc-framework-StoreKit-3.0.4/egg-dist-tmp-7fnscr
warning: no directories found matching 'Scripts'
warning: no directories found matching 'setup-lib'
warning: no directories found matching 'source-deps'
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.dSYM/*' found anywhere in distribution
warning: no previously-included files matching '*.dSYM' found anywhere in distribution
warning: no previously-included files matching '__pycache__' found anywhere in distribution
Modules/objc/objc-runtime-compat.m:885:17: error: cannot find interface
declaration for 'Object'; did you mean 'NSObject'?
@implementation Object (NSObjectCompat)
^~~~~~
NSObject
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:76:12: note:
'NSObject' declared here
@interface NSObject <NSObject> {
^
Modules/objc/objc-runtime-compat.m:891:1: warning: method has no return type
specified; defaults to 'id' [-Wmissing-method-return-type]
-doesNotRecognizeSelector:(SEL)sel
^
(id)
Modules/objc/objc-runtime-compat.m:886:1: warning: category is implementing a
method which will also be implemented by its primary class
[-Wobjc-protocol-method-implementation]
- (id)self
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:20:1: note:
method 'self' declared here
- (id)self;
^
2 warnings and 1 error generated.
error: Setup script exited with error: command 'clang' failed with exit status 1
2)$ env CC=clang easy_install -U pyobjc-core
$ env CC=clang easy_install -U pyobjc-core
Searching for pyobjc-core
Reading https://pypi.python.org/simple/pyobjc-core/
Best match: pyobjc-core 3.0.4
Downloading https://pypi.python.org/packages/source/p/pyobjc-core/pyobjc-core-3.0.4.tar.gz#md5=6baaa0d2533cc9c26ad9f889ca9ecb01
Processing pyobjc-core-3.0.4.tar.gz
Writing /var/folders/1s/520_dbbj7r9fhx093c93_jf80000gn/T/easy_install-5hi4rp/pyobjc-core-3.0.4/setup.cfg
Running pyobjc-core-3.0.4/setup.py -q bdist_egg --dist-dir /var/folders/1s/520_dbbj7r9fhx093c93_jf80000gn/T/easy_install-5hi4rp/pyobjc-core-3.0.4/egg-dist-tmp-FUyEFV
warning: no directories found matching 'Scripts'
warning: no directories found matching 'setup-lib'
warning: no directories found matching 'source-deps'
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.dSYM/*' found anywhere in distribution
warning: no previously-included files matching '*.dSYM' found anywhere in distribution
warning: no previously-included files matching '__pycache__' found anywhere in distribution
Modules/objc/objc-runtime-compat.m:885:17: error: cannot find interface
declaration for 'Object'; did you mean 'NSObject'?
@implementation Object (NSObjectCompat)
^~~~~~
NSObject
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:76:12: note:
'NSObject' declared here
@interface NSObject <NSObject> {
^
Modules/objc/objc-runtime-compat.m:891:1: warning: method has no return type
specified; defaults to 'id' [-Wmissing-method-return-type]
-doesNotRecognizeSelector:(SEL)sel
^
(id)
Modules/objc/objc-runtime-compat.m:886:1: warning: category is implementing a
method which will also be implemented by its primary class
[-Wobjc-protocol-method-implementation]
- (id)self
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:20:1: note:
method 'self' declared here
- (id)self;
^
2 warnings and 1 error generated.
error: Setup script exited with error: command 'clang' failed with exit status 1
3)导航到石英目录后......
$ python setup.py install
newusers-MacBook:pyobjc-framework-quartz-3.0.4 newuser$ python setup.py install
warning: no directories found matching 'Scripts'
warning: no directories found matching 'setup-lib'
warning: no directories found matching 'source-deps'
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.dSYM/*' found anywhere in distribution
warning: no previously-included files matching '*.dSYM' found anywhere in distribution
warning: no previously-included files matching '__pycache__' found anywhere in distribution
Modules/objc/objc-runtime-compat.m:885:17: error: cannot find interface
declaration for 'Object'; did you mean 'NSObject'?
@implementation Object (NSObjectCompat)
^~~~~~
NSObject
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:76:12: note:
'NSObject' declared here
@interface NSObject <NSObject> {
^
Modules/objc/objc-runtime-compat.m:891:1: warning: method has no return type
specified; defaults to 'id' [-Wmissing-method-return-type]
-doesNotRecognizeSelector:(SEL)sel
^
(id)
Modules/objc/objc-runtime-compat.m:886:1: warning: category is implementing a
method which will also be implemented by its primary class
[-Wobjc-protocol-method-implementation]
- (id)self
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:20:1: note:
method 'self' declared here
- (id)self;
^
2 warnings and 1 error generated.
Traceback (most recent call last):
File "setup.py", line 81, in <module>
[ 'Modules/_coregraphics.m' ], extra_link_args=["-framework", "ApplicationServices"]),
File "/Users/newuser/Downloads/pyobjc-framework-Quartz-3.0.4/pyobjc_setup.py", line 460, in setup
**k
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "build/bdist.macosx-10.6-intel/egg/setuptools/dist.py", line 268, in __init__
File "build/bdist.macosx-10.6-intel/egg/setuptools/dist.py", line 313, in fetch_build_eggs
File "build/bdist.macosx-10.6-intel/egg/pkg_resources/__init__.py", line 836, in resolve
File "build/bdist.macosx-10.6-intel/egg/pkg_resources/__init__.py", line 1081, in best_match
File "build/bdist.macosx-10.6-intel/egg/pkg_resources/__init__.py", line 1093, in obtain
File "build/bdist.macosx-10.6-intel/egg/setuptools/dist.py", line 380, in fetch_build_egg
File "build/bdist.macosx-10.6-intel/egg/setuptools/command/easy_install.py", line 629, in easy_install
File "build/bdist.macosx-10.6-intel/egg/setuptools/command/easy_install.py", line 659, in install_item
File "build/bdist.macosx-10.6-intel/egg/setuptools/command/easy_install.py", line 842, in install_eggs
File "build/bdist.macosx-10.6-intel/egg/setuptools/command/easy_install.py", line 1070, in build_and_install
File "build/bdist.macosx-10.6-intel/egg/setuptools/command/easy_install.py", line 1058, in run_setup
distutils.errors.DistutilsError: Setup script exited with error: command 'clang' failed with exit status 1
newusers-MacBook:pyobjc-framework-quartz-3.0.4 newuser$