[Pythonmac-SIG] xcode problems

Muhammad Alkarouri malkarouri at yahoo.co.uk
Fri Oct 20 08:29:41 CEST 2006


---  Ronald Oussoren wrote:
...
> I'd drop Xcode unless you already know it, Xcode can be used as a  
> python editor but is really heavy-weight for what it offers to Python  
> programmers (it's great for ObjC programming, but most of Xcode is  
> closed for Python programmers).

Noted. I am at the moment trying TextWrangler for editing Python. May be I will
revert to Idle.
[rant]
It is a shame, though. Xcode is a great python environment, as far as my
experience goes. It would be far more useful if it were open source.
[/rant]

> > - The next problem is in the code itself. When trying to run the  
> > application
> > PyAverager I get an error:
> > PyAverager[3377] Unknown class `Averager' in nib file, using  
> > `NSObject' instead
> 
> Where did you find this example? It isn't part of the PyObjC  
> distribution, so I can't help you here without further information.

Yes. This is the example from the Apple web site
(http://developer.apple.com/cocoa/pyobjc.html).
I did find the error, though, and it is an xcode peculiarity/bug. Namely, when
you create a new Python class file in xcode it doesn't get added to "Classes"
in the xcode project. You have to drag it there manually.

> > - Is there anyway to automate the change of setup.py to use
> > /usr/local/bin/python at each new project, rather than doing it  
> > manually?
> 
> The 2.4.3, 2.4.4 and 2.5 installers for python should ensure that the  
> right directory (which isn't /usr/local/bin b.t.w.) is on $PATH. What  
> is your shell environment? I assume you use the default shell (bash),  
> do you have any custom startup files  
> (.profile, .bashrc, .bash_login, ...)?

I have installed the Python 2.5 for OS X from python.org. And I have this now

==================
muhammad-alkarouris-computer:~ malkarouri$ which python
/Library/Frameworks/Python.framework/Versions/Current/bin/python
muhammad-alkarouris-computer:~ malkarouri$ ls -l /usr/local/bin/python
lrwxr-xr-x   1 root  wheel  68 Oct 15 06:13 /usr/local/bin/python ->
../../../Library/Frameworks/Python.framework/Versions/2.5/bin/python
muhammad-alkarouris-computer:~ malkarouri$ echo $PATH
/Library/Frameworks/Python.framework/Versions/Current/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/teTeX/bin/i386-apple-darwin-current
muhammad-alkarouris-computer:~ malkarouri$ cat .bash_profile 

# Setting PATH for MacPython 2.5
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:${PATH}"
export PATH
muhammad-alkarouris-computer:~ malkarouri$ 
==================

So, the installer did install /usr/local/bin/python. Through .bash_profile,
python2.5 is the default for my shell, while python2.3 is the default for
everything else. This is fine by me. I assume that is the right approach. Or is
there another installer?

> It would be nice if that button worked, but I don't have time to fix  
> this. Making changes to the xcode templates is no fun, even if you do  
> know how to do so  which I don't.
> 
> PyObjC is a bit in flux at the moment, we've transitioned to  
> setuptools but never got around to completely finishing that  
> transition, which explains the lack of binary installers.

Keep up the good work. For now, PyObjC 1.4 source installation for both Python
2.5 and Python 2.3 are working fine.

Thanks again,

k

Send instant messages to your online friends http://uk.messenger.yahoo.com 


More information about the Pythonmac-SIG mailing list