[Pythonmac-SIG] Re: Newbie path problem

Jack Jansen Jack.Jansen at cwi.nl
Thu Feb 26 06:35:01 EST 2004


On 25-feb-04, at 23:39, Christer Fernstrom wrote:

> I have just ported some of my own python code from os x 10.1 to Python 
> 2.3 on OSX 10.3 and come upon a problem with the path which would 
> surprise me if not several others have. One module imports another 
> module residing in the same directory, which is not on the PYTHONPATH. 
> This works fine when running from the terminal, and it used to work 
> fine in my earlier installation also after using BuildApplet to create 
> an application applet. This does not work in Python 2.3. Instead it  
> generates an import error.
>
> Tracing sys.path, I notice that its first two elements are equal:
> 	<scripts-directory>/<scripts-name>.app/Contents/Resources

You have to explain this a bit more. You say "One module imports 
another module residing in the same directory, which is not on the 
PYTHONPATH". How do you import the first module then, as it is in a 
directory that also isn't on sys.path?

--
Jack Jansen, <Jack.Jansen at cwi.nl>, http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma 
Goldman




More information about the Pythonmac-SIG mailing list