有人在 Snow Leopard 中成功构建了 PyObjC 应用程序吗?

发布于 2024-08-02 06:02:32 字数 421 浏览 6 评论 0原文

如果你这样做了,你介意分享你是如何安装 pyobjc 的吗?我试图通过安装 PythonMac 2.5(对于通过 py2app 的独立包)并执行 PyObjC 的 easy_install 来做到这一点。我总是收到那些 deprecated 错误,主要是在 dyld.hobjc_inject.m 中声明的错误。

我尝试从源代码编译但仍然没有成功。

另外,当我在 Snow Leopard 下运行 Leopard 编译的 PyObjC 应用程序时,它出现有关 PyObjC 的错误,第一次是看不到 FoundationAppKit,第二次是 < code>typestr 未知。

感谢并感谢您的回答。

If you did, would you mind sharing how you did the pyobjc install? I was trying to do it by installing PythonMac 2.5 (for the standalone bundle thru py2app), and doing easy_install of PyObjC. I always get those deprecated errors, primarily those declared in dyld.h, and inside objc_inject.m.

I tried compiling from source but still no luck.

Also, when I run my Leopard-compiled PyObjC app under Snow Leopard, it has errors concerning PyObjC, first time was it can't see Foundation or AppKit, second was typestr is unknown.

Thanks and appreciate your answers.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

枕头说它不想醒 2024-08-09 06:02:32

如果您安装 XCode Developer 工具(可选的 Snow Leopard 安装),则根本不需要手动安装 PyObjC。测试方法如下:

$ python
Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import Foundation
>>> Foundation.NSString.stringWithString_(u'hello PyObjC')
u'hello PyObjC'
>>> 

如果 Foundation、AppKit、ScriptingBridge、模块可以导入,那么一切都正常。

If you install the XCode Developer tools (optional Snow Leopard install), there's no need to manually install PyObjC at all. Here's how you can test it:

$ python
Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import Foundation
>>> Foundation.NSString.stringWithString_(u'hello PyObjC')
u'hello PyObjC'
>>> 

If the Foundation, AppKit, ScriptingBridge, modules can be imported, then everything is alright.

夜未央樱花落 2024-08-09 06:02:32

我已经找到了一种方法...虽然我不知道这是官方的还是什么...

我下载了 2.5 版本的 PythonMac,安装了它,然后在安装目录中添加了一个符号链接,例如:

sudo ln -s /System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python /Library/Frameworks/Python.framework/Versions/2.5/lib/site-python

这部分使它看起来好像捆绑的 PyObjC 二进制文件是 PythonMac 安装的一部分,当我执行 easy_install 时,系统站点包不会受到影响。另外,值得注意的是,您不应该通过 easy_install-ing py2app 与系统捆绑的 py2app 发生冲突,否则您将遇到 typestr 错误。

我想知道这对于我能够在 Snow Leopard 下制作独立的 PyObjC 应用程序是否有任何问题。

I already found a way... though I dunno if this is official or what...

I downloaded 2.5 version of PythonMac, installed it, and then added a symlink inside the installation directory, e.g.:

sudo ln -s /System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python /Library/Frameworks/Python.framework/Versions/2.5/lib/site-python

This part made it seem as if the bundled PyObjC binaries are part of the PythonMac installation, and when I do easy_install, the system site-packages won't get affected. Also, worth noting is that you shouldn't conflict the system-bundled py2app by easy_install-ing py2app or else you'll encounter a typestr error.

I wanna know if there's anything wrong with this for me to be able to make a standalone PyObjC application under Snow Leopard.

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