4

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!

Nathan
  • 6,772
  • 11
  • 38
  • 55

1 Answers1

2

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.

Community
  • 1
  • 1
jscs
  • 63,694
  • 13
  • 151
  • 195
  • thanks for the info. So, basically, I have to wait for PyObjC to catch up with Python 3 before I can safely use it, right? – Nathan May 15 '11 at 21:36
  • So far as I know, yes. There may be more details in the [mailing list](https://lists.sourceforge.net/lists/listinfo/pyobjc-dev) archives, and if not, you could post a message to the list. From what I've seen, the PyObjC dev, Roland, is very busy but not unfriendly. – jscs May 15 '11 at 21:42
  • anyone know what the current situation is with this?? – Bennett Von Bennett Apr 06 '12 at 20:17
  • @Bennett: The current situation is an utter pain; there's no Interface Builder support at all. See http://stackoverflow.com/questions/5276967/python-in-xcode-4 and http://stackoverflow.com/questions/5843508/pyobjc-on-xcode-4 – jscs Apr 06 '12 at 20:22