从 pyobjc 2.2 降级到 pyobjc 2.0
我不小心用易于安装的 pyobjc 安装了 pyobjc 2.2,它导致了问题:当我尝试导入它时,我收到错误,
Incompatible library version: _objc.so requires version 10.0.0 or later, but libxml2.2.dylib provides version 9.0.0
但我对修复该错误不感兴趣,我想要的只是恢复我的 pyobjc 2.0。我尝试删除 pyobjc 2.2 并重新安装 python,并且尝试从 svn trunk 构建 2.0 (我收到错误 lipo: 无法弄清楚 [random filename].out 的架构)
我想一定有一个这样做的好方法,但它逃脱了我。任何见解将不胜感激。
编辑:Python 2.6 和 OSX 10.5
I accidentally installed pyobjc 2.2 with easy-install pyobjc, and it's causing problems: When I try to import it I get the error
Incompatible library version: _objc.so requires version 10.0.0 or later, but libxml2.2.dylib provides version 9.0.0
I'm not interested in fixing that though, all I want is my pyobjc 2.0 back. I've tried removing pyobjc 2.2 and reinstalling python, and I've tried building 2.0 from the svn trunk (I get the error lipo: can't figure out the architecture of [random filename].out)
I imagine there must be a good way of doing this but it escapes me. Any insight would be appreciated.
Edit: Python 2.6 and OSX 10.5
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您在 10.5 Leopard 上使用 Apple 提供的 Python 2.5(内置 PyObjC 2.0),最简单的降级方法可能是从其站点包目录
/Library/Python/ 中删除 2.2 版本2.5/站点包
。首先,运行以下命令:这将编辑该目录中的
easy-install.pth
文件,或者您可以自己编辑该文件以删除 PyObjC 2.2 的行。然后应该恢复到苹果提供的安装在其他地方的版本。如果您使用的是其他版本的 Python 并自己安装了 PyObjC,您仍然可以使用 easy_install 恢复到它,因为通常情况下,easy_install 在升级时不会删除以前的版本。尝试:
如果这不起作用,您可能必须转到 PyObjC subversion 存储库并下载 2.0 分支的副本并从那里重新安装:
If you are using the Apple-supplied Python 2.5 on 10.5 Leopard, which comes with PyObjC 2.0 built-in, probably the easiest way to downgrade is to remove the 2.2 version from its site-packages directory,
/Library/Python/2.5/site-packages
. First, though, run the command:which will edit the
easy-install.pth
file in that directory or you can edit the file yourself to remove the line for PyObjC 2.2. That should then revert back to the Apple-supplied version which is installed elsewhere.If you are using another version of Python and installed PyObjC yourself, you still may be able to use easy_install to revert to it since, normally, easy_install does not remove previous versions when you upgrade. Try:
If that doesn't work, you may have to go to the PyObjC subversion repository and download a copy of the 2.0 branch and re-install from there:
我想通了。 2.5 pyobjc 库位于 /System/Library/Frameworks/Python.framework/Versions/2.5/...
为 python 2.6 安装 pyobjc 的命令是
无论如何感谢您的帮助!
I figured it out. The 2.5 pyobjc library is in /System/Library/Frameworks/Python.framework/Versions/2.5/...
and the command to install pyobjc for python 2.6 is
Thanks anyways for the help!