简体   繁体   中英

How to install PyObjC with Python 3 and Xcode 3 on Mac OS X 10.6

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!

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM