开发者

Error in `import objc` : Symbol not found: _PyType_Modified

My system is Mac OS X 10.5.8 and I have installed python from http://www.python.org/ftp/python/2.5.4/python-2.5.4-macosx.dmg because I do not want to use System python (python which already comes installed with Mac OS X) and have totally removed system python.

Now when I try to install pyobjc it installs, but on import gives error

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

Has anybody installed pyobjc with python.org python?

If it is of help, here are the warnings while doing "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: warnin开发者_运维问答g: 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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜