无法在 OS X 10.6.3 Snow Leopard 上的 Python 中导入 obj - libiconv.2.dylib?
在 OS X 10.6.3 Snow Leopard 上
% python Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import objc Traceback (most recent call last): File "", line 1, in File "/Library/Python/2.6/site-packages/pyobjc_core-2.2-py2.6-macosx-10.6-universal.egg/objc/__init__.py", line 22, in _update() File "/Library/Python/2.6/site-packages/pyobjc_core-2.2-py2.6-macosx-10.6-universal.egg/objc/__init__.py", line 19, in _update import _objc ImportError: dlopen(/Library/Python/2.6/site-packages/pyobjc_core-2.2-py2.6-macosx-10.6-universal.egg/objc/_objc.so, 2): Library not loaded: /opt/local/lib/libiconv.2.dylib Referenced from: /Library/Python/2.6/site-packages/pyobjc_core-2.2-py2.6-macosx-10.6-universal.egg/objc/_objc.so Reason: Incompatible library version: _objc.so requires version 8.0.0 or later, but libiconv.2.dylib provides version 7.0.0 >>>
-- 我需要做什么?
on OS X 10.6.3 Snow Leopard
% python Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import objc Traceback (most recent call last): File "", line 1, in File "/Library/Python/2.6/site-packages/pyobjc_core-2.2-py2.6-macosx-10.6-universal.egg/objc/__init__.py", line 22, in _update() File "/Library/Python/2.6/site-packages/pyobjc_core-2.2-py2.6-macosx-10.6-universal.egg/objc/__init__.py", line 19, in _update import _objc ImportError: dlopen(/Library/Python/2.6/site-packages/pyobjc_core-2.2-py2.6-macosx-10.6-universal.egg/objc/_objc.so, 2): Library not loaded: /opt/local/lib/libiconv.2.dylib Referenced from: /Library/Python/2.6/site-packages/pyobjc_core-2.2-py2.6-macosx-10.6-universal.egg/objc/_objc.so Reason: Incompatible library version: _objc.so requires version 8.0.0 or later, but libiconv.2.dylib provides version 7.0.0 >>>
--
what do I need to do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
首先,我尝试临时将
/Library/Python/2.6/site-packages/pyobjc_core-2.2-py2.6-macosx-10.6-universal.egg/
移动到其他地方并尝试 import 语句再次。这将使操作系统能够默认导入操作系统附带的objc
版本(位于/System/Library
中)。通过使用/System/Library
中的版本,它对我有用:您也可以考虑将
/opt/local/lib/libiconv.2.dylib
移动到其他地方。它看起来已经过时了,OS X Snow Leopard 在/usr/lib
IIRC 中有自己的libiconv.2.dylib
副本。First I'd try to temporary move
/Library/Python/2.6/site-packages/pyobjc_core-2.2-py2.6-macosx-10.6-universal.egg/
to somewhere else and try the import statement again. This will enable the OS to import the version ofobjc
that came with the OS by default (this is in/System/Library
). By using the version in/System/Library
, it works for me:You might also consider moving
/opt/local/lib/libiconv.2.dylib
to somewhere else. It looks outdated and OS X Snow Leopard has its own copy oflibiconv.2.dylib
in/usr/lib
IIRC.您很可能搞砸了操作系统的 Python 安装,因此您很可能需要重新安装操作系统。
You more than likely screwed with the OS's Python installation, so you'll more than likely need to reinstall your OS.