`import objc`出错:找不到符号:_PyType_Modified

时间:2010-07-14 13:13:18

标签: python pyobjc

我的系统是Mac OS X 10.5.8,我已经从http://www.python.org/ftp/python/2.5.4/python-2.5.4-macosx.dmg安装了python,因为我不想使用System python(已经安装了Mac OS X的python)并完全删除了系统python。

现在当我尝试安装pyobjc时,它会安装,但是在导入时会出错

Python 2.5.4 (r254:67917, Dec 23 2008, 14:57:27) 
[GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import objc
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pyobjc_core-2.2-py2.5-macosx-10.3-i386.egg/objc/__init__.py", line 22, in <module>
    _update()
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pyobjc_core-2.2-py2.5-macosx-10.3-i386.egg/objc/__init__.py", line 19, in _update
    import _objc
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pyobjc_core-2.2-py2.5-macosx-10.3-i386.egg/objc/_objc.so, 2): 
Symbol not found: _PyType_Modified
  Referenced from: /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pyobjc_core-2.2-py2.5-macosx-10.3-i386.egg/objc/_objc.so
  Expected in: dynamic lookup

有人用python.org python安装了pyobjc吗?

如果它有帮助,这里是做“easy_install pyobjc”时的警告

Running pyobjc-core-2.2/setup.py -q bdist_egg --dist-dir /var/folders/tW/tWnuazCRFjexteMIweC5H++++TI/-Tmp-/easy_install-jttwg4/pyobjc-core-2.2/egg-dist-tmp-vuhvjT
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 '*.so' found anywhere in distribution
libffi-src/powerpc/ppc-ffi_darwin.c:95: warning: no previous prototype for 'ffi_prep_args'
libffi-src/powerpc/ppc-ffi_darwin.c:819: warning: no previous prototype for 'ffi_closure_helper_DARWIN'
libffi-src/powerpc/ppc-ffi_darwin.c: In function 'ffi_closure_helper_DARWIN':
libffi-src/powerpc/ppc-ffi_darwin.c:854: warning: comparison between signed and unsigned
libffi-src/powerpc/ppc-ffi_darwin.c:910: warning: pointer of type 'void *' used in arithmetic
libffi-src/powerpc/ppc-ffi_darwin.c:910: warning: pointer of type 'void *' used in arithmetic
libffi-src/x86/x86-ffi_darwin.c:39: warning: no previous prototype for 'ffi_prep_args'
libffi-src/x86/x86-ffi_darwin.c:178: warning: function declaration isn't a prototype
libffi-src/x86/x86-ffi_darwin.c:186: warning: function declaration isn't a prototype
Modules/objc/objc-class.m: In function 'PyObjCClass_New':
Modules/objc/objc-class.m:1416: warning: implicit declaration of function 'PyType_Modified'
Modules/objc/objc-class.m:1416: warning: nested extern declaration of 'PyType_Modified'
Modules/objc/objc-class.m: In function 'PyObjCClass_New':
Modules/objc/objc-class.m:1416: warning: implicit declaration of function 'PyType_Modified'
Modules/objc/objc-class.m:1416: warning: nested extern declaration of 'PyType_Modified
Modules/objc/OC_PythonObject.m: In function '-[OC_PythonObject replacementObjectForKeyedArchiver:]':
Modules/objc/OC_PythonObject.m:1370: warning: conflicting types for '-(NSObject *)replacementObjectForKeyedArchiver:(NSKeyedArchiver *)archiver'
Modules/objc/OC_PythonObject.h:102: warning: previous declaration of '-(NSObject *)replacementObjectForKeyedArchiver:(NSObject *)archiver'
Modules/objc/OC_PythonObject.m: In function '-[OC_PythonObject replacementObjectForCoder:]':
Modules/objc/OC_PythonObject.m:1376: warning: conflicting types for '-(NSObject *)replacementObjectForCoder:(NSCoder *)archiver'
Modules/objc/OC_PythonObject.h:103: warning: previous declaration of '-(NSObject *)replacementObjectForCoder:(NSObject *)archiver'
Modules/objc/OC_PythonObject.m: In function '-[OC_PythonObject replacementObjectForPortCoder:]':
Modules/objc/OC_PythonObject.m:1382: warning: conflicting types for '-(NSObject *)replacementObjectForPortCoder:(NSPortCoder *)archiver'
Modules/objc/OC_PythonObject.h:104: warning: previous declaration of '-(NSObject *)replacementObjectForPortCoder:(NSObject *)archiver'
Modules/objc/OC_PythonObject.m: In function '-[OC_PythonObject replacementObjectForKeyedArchiver:]':
Modules/objc/OC_PythonObject.m:1370: warning: conflicting types for '-(NSObject *)replacementObjectForKeyedArchiver:(NSKeyedArchiver *)archiver'
Modules/objc/OC_PythonObject.h:102: warning: previous declaration of '-(NSObject *)replacementObjectForKeyedArchiver:(NSObject *)archiver'
Modules/objc/OC_PythonObject.m: In function '-[OC_PythonObject replacementObjectForCoder:]':
Modules/objc/OC_PythonObject.m:1376: warning: conflicting types for '-(NSObject *)replacementObjectForCoder:(NSCoder *)archiver'
Modules/objc/OC_PythonObject.h:103: warning: previous declaration of '-(NSObject *)replacementObjectForCoder:(NSObject *)archiver'
Modules/objc/OC_PythonObject.m: In function '-[OC_PythonObject replacementObjectForPortCoder:]':
Modules/objc/OC_PythonObject.m:1382: warning: conflicting types for '-(NSObject *)replacementObjectForPortCoder:(NSPortCoder *)archiver'
Modules/objc/OC_PythonObject.h:104: warning: previous declaration of '-(NSObject *)replacementObjectForPortCoder:(NSObject *)archiver'
Modules/objc/test/protocol.m:19: warning: incomplete implementation of class 'OC_TestProtocolClass'
Modules/objc/test/protocol.m:19: warning: method definition for '-method2:' not found
Modules/objc/test/protocol.m:19: warning: method definition for '-method1' not found
Modules/objc/test/protocol.m:19: warning: class 'OC_TestProtocolClass' does not fully implement the 'OC_TestProtocol' protocol
Modules/objc/test/protocol.m:19: warning: incomplete implementation of class 'OC_TestProtocolClass'
Modules/objc/test/protocol.m:19: warning: method definition for '-method2:' not found
Modules/objc/test/protocol.m:19: warning: method definition for '-method1' not found
Modules/objc/test/protocol.m:19: warning: class 'OC_TestProtocolClass' does not fully implement the 'OC_TestProtocol' protocol
Modules/objc/test/testclassandinst.m: In function '+[PyObjC_TestUnallocatable allocWithZone:]':Modules/objc/test/testclassandinst.m: In function '+[PyObjC_TestUnallocatable allocWithZone:]':
Modules/objc/test/testclassandinst.m:22: warning: unused parameter 'zone'
Modules/objc/test/testclassandinst.m:22: warning: unused parameter 'zone'

0 个答案:

没有答案