[GRASS-dev] Re: python not launching in trunk

Glynn Clements glynn at gclements.plus.com
Sat Jul 26 19:15:29 EDT 2008


Michael Barton wrote:

> I am only receiving this error with wxGUI, not with any other wxPython  
> applications. It also only happens AFTER the initial gis_setup.py  
> screen (i.e., in wxPython and working fine) when it tries to start  
> wx_gui.py.
> 
> Given my other problem mentioned earlier, I'm concerned that this is  
> the result of an internal version check that is failing on the Mac  
> even if correct version are installed.
> 
> Glynn may be right about a PYTHONPATH problem, but I do have an  
> extensive, and AFAICT correct, PYTHONPATH on that computer. I may try  
> to update GRASS and compile on my MacBook this weekend to see if it is  
> something specific to my office computer or if it is something that  
> changed in the GRASS source code.
> 
> Something interesting that William Kyngesbury just said that helps one  
> issue I'm having. Apparently the startup app for GRASS compiled on a  
> Mac ignores the .grass_bashrc file. This is not where my PYTHONPATH   
> is located, but is where I was putting some environmental settings  
> related to a Python issue on the MacBook--and they were not taking.

The contents of ~/.grass.bashrc are copied into the <mapset>/.bashrc
file, which is loaded by the session shell. It doesn't affect anything
other than the session shell (e.g. Init.sh, or any GUI spawned from
it).

Also, note that some Python scripts are run using $GRASS_PYTHON, while
others use "python". If $GRASS_PYTHON is something other than
"python", you will get varying behaviour.

Specifically, Init.sh uses $GRASS_PYTHON to run gis_set.py but,
AFAICT, nothing else uses that variable. The wxgui script (which is a
shell script) uses "python", as does g.gui. Any scripts which are run
directly will use the #! line, which will presumably use "python" (you
can't use environment variables there, and I don't know if the Tcl
"polyglot hack" has a Python equivalent).

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list