[GRASS-dev] Python script test

William Kyngesburye woklist at kyngchaos.com
Mon Jul 21 10:12:21 EDT 2008


On Jul 21, 2008, at 4:17 AM, Glynn Clements wrote:

>
> Michael Barton wrote:
>
>> Init.sh is not updating PYTHONPATH on my Mac for some reason. I've
>> looked at the code and it seems fine. I DO have a PYTHONPATH. So I'm
>> not sure why it is not updating it. If I change it manually, by  
>> simply
>> pasting your code (export PYTHONPATH="$GISBASE/etc/python:
>> $PYTHONPATH") into the GRASS prompt, PYTHONPATH IS modified
>> appropriately and r_in_aster.py works fine with the new grass.py
>> library.
>
> I suspect that /etc/profile resets PYTHONPATH. Init.sh creates a
> .bashrc script in the mapset directory (which, at the point that the
> session shell is started, is $HOME), and that script sources
> /etc/profile.
>
> That's almost certainly bogus. /etc/profile is only meant to be
> sourced by login shells, not by subshells, largely for reasons such as
> this. I have fixed this in SVN trunk.
>
As far as I can tell, the OSX /etc/profile only *adds* to PATH and  
MANPATH, and doesn't touch python stuff.

Are you sure you added PYTHONPATH code to init.sh?  I don't see  
anything that sets PYTHONPATH. (just updated SVN, checked trunk also)

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"This is a question about the past, is it? ... How can I tell that the  
past isn't a fiction designed to account for the discrepancy between  
my immediate physical sensations and my state of mind?"

- The Ruler of the Universe




More information about the grass-dev mailing list