如何在 Mac OS X 10.6 上使用 Python 3 和 Xcode 3 安装 PyObjC

发布于 2024-11-07 06:59:07 字数 218 浏览 2 评论 0原文

我想开始使用 PyObjC。我在 OS X 10.6 上安装了 Xcode 3

我安装了 Python 3.2 和 2.6,但我想使用 3.2

我听说包含 PyObjC 并且我只是在 Xcode New Project 对话框中选择它,但我没有没有看到该选项。这让我假设我错过了一些安装步骤。

有人可以告诉我如何通过我的配置设置并开始使用 PyObjC 吗?
谢谢!

I want to start using PyObjC. I've got Xcode 3 on OS X 10.6

I have both Python 3.2 and 2.6 installed, but I want to use 3.2

I've heard that PyObjC is included and that I just select it in the Xcode New Project dialog, but I don't see the option. This makes me assume I've missed some install step.

Can someone tell me how to setup and start using PyObjC with my configuration?

Thanks!

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

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

发布评论

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

评论(1

栖迟 2024-11-14 06:59:07

PyObjC 已安装: /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC/

您缺少的部分是项目和文件模板。 Apple 停止包含 Leopard 前后的那些内容,因为 Xcode 和 PyObjC 开发周期根本不同步。

您可以从 PyObjC 存储库 自行下载它们;将它们安装在〜/ Library / Application Support / Developer / Shared / Xcode / Project Templates中并
~/Library/Application Support/Developer/Shared/Xcode/File Templates,您应该准备好开始了。

请注意,Apple 提供的 PyObjC 是旧版本 (2.2bsomething),这意味着不幸的是它无法与 Python 3* 一起使用。您必须构建自己的框架副本。另一个大麻烦是,这个默认 PyObjC 中的元数据不包含很多在 Snow Leopard 中添加到 Cocoa 的内容(特别是与块有关的内容)。文档中任何显示“在 10.6 及更高版本中可用”的内容在系统 PyObjC 中都不可用,因此您可能会发现自己也因此必须构建并静态链接较新的版本。


*PyObjC 中对 Python 3 的支持相当新且可能不稳定 - 描述为v2 中的“pre-alpha”。 3 新闻.txt

PyObjC is installed: /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC/

The parts you're missing are the Project and File Templates. Apple stopped including those around the time of Leopard, because the Xcode and PyObjC development cycles are not at all synced up.

You can download them yourself from the PyObjC repository; install them in ~/Library/Application Support/Developer/Shared/Xcode/Project Templates and
~/Library/Application Support/Developer/Shared/Xcode/File Templates and you should be ready to roll.

Note that the Apple-supplied PyObjC is an older version (2.2bsomething), which means that unfortunately it won't work with Python 3*. You'd have to build your own copy of the framework. The other big annoyance about this is that the metadata in this default PyObjC doesn't include a lot of stuff (particularly to do with blocks) which was added to Cocoa in Snow Leopard. Anything that says "Available in 10.6 and later" in the docs isn't available in the system PyObjC, so you may find yourself having to build and statically link a newer version for that reason too.


*And support for Python 3 in PyObjC is fairly new and potentially shaky -- described as "pre-alpha" in v2.3 NEWS.txt.

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