`import objc` 中的错误:找不到符号:_PyType_Modified
我的系统是 Mac OS X 10.5.8,我已经从 http://www.python.org/ftp/python/2.5.4/python-2.5.4-macosx.dmg 因为我不想使用系统 python (python 已经自带了与 Mac OS X 一起安装)并完全删除了系统 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'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论