XCode 4 and Python

Discussion in 'Mac Programming' started by FluJunkie, Mar 12, 2011.

  1. FluJunkie macrumors 6502a

    Jul 17, 2007
    Does the newest XCode support Python natively? The weird PyObjC workarounds and the like that exist online never worked out for me - I suspect because I wasn't using the built-in Python install at that point (I prefer the Enthought distribution).

    Or is it still...a bit more trouble than it's worth?
  2. larkost macrumors 6502a

    Oct 13, 2007
    If you are not using the built-in Python, then the chances of PyObjC working are just about nil (python has to be modified to support the bridges, third party distributions do not have these modifications).

    And Apple has not been including the PyObjC templates for a while now. I suspect that simply installing them from the PyObjC project page will get you back and running there. I don't suspect that any of XCode's nice new editing features (such as class lookup) are going to work, since Clang does not understand python.
  3. AlmostThere macrumors 6502a

    PyObjC works fine with MacPorts python (port install py26-pyobjc, or whichever version of Python you are using). Not all the frameworks are on MacPorts but you can then easy-install-2.x from this list quite happily


    HostName:~ username$ python
    Python 2.6.6 (r266:84292, Jan 30 2011, 01:41:50) 
    [GCC 4.2.1 (Apple Inc. build 5664)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import Foundation 
    >>> import AppKit
    >>> import WebKit
  4. gtr053 macrumors member

    Jan 2, 2010
    Tuscaloosa, AL
    I posted some step by step instructions on how to do this here.

Share This Page