从 pyobjc 2.2 降级到 pyobjc 2.0

发布于 2024-08-17 14:27:38 字数 420 浏览 6 评论 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

药祭#氼 2024-08-24 14:27:38

如果您在 10.5 Leopard 上使用 Apple 提供的 Python 2.5(内置 PyObjC 2.0),最简单的降级方法可能是从其站点包目录 /Library/Python/ 中删除 2.2 版本2.5/站点包。首先,运行以下命令:

easy_install -m pyobjc==2.2

这将编辑该目录中的 easy-install.pth 文件,或者您可以自己编辑该文件以删除 PyObjC 2.2 的行。然后应该恢复到苹果提供的安装在其他地方的版本。

如果您使用的是其他版本的 Python 并自己安装了 PyObjC,您仍然可以使用 easy_install 恢复到它,因为通常情况下,easy_install 在升级时不会删除以前的版本。尝试:

easy_install pyobjc==2.0

如果这不起作用,您可能必须转到 PyObjC subversion 存储库并下载 2.0 分支的副本并从那里重新安装:

svn co http://svn.red-bean.com/pyobjc/branches/pyobjc-20x-branch/

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:

easy_install -m pyobjc==2.2

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:

easy_install pyobjc==2.0

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:

svn co http://svn.red-bean.com/pyobjc/branches/pyobjc-20x-branch/
新一帅帅 2024-08-24 14:27:38

我想通了。 2.5 pyobjc 库位于 /System/Library/Frameworks/Python.framework/Versions/2.5/...
为 python 2.6 安装 pyobjc 的命令是

sudo port install py26-pyobjc2

无论如何感谢您的帮助!

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

sudo port install py26-pyobjc2

Thanks anyways for the help!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文