[GRASS-user] Running Python scripts inside GRASS

Glynn Clements glynn at gclements.plus.com
Fri Mar 5 14:24:25 EST 2010


Sonja Jankowfsky wrote:

> So, I changed the hole content of my C:\GRASS-4-SVN\Python25 directory 
> with the content of the C:\Python26 directory. I kept the name 
> (Python25) of the directory and the Scripts directory and sip.exe.
> 
> Now, I can run my Pythonprogramm under the GRASS windows command line, 
> however I can no longer use the Pythonwx GUI. (which does not seem 
> surprising due to the brutal changes I made ;-))
> 
> I don't know anything about the differences between Python25 and 
> Python26 and the dependencies for the wxpython GUI, but in my opinion it 
> would be necessary to update the WinGRASS installation with a Python26 
> version while keeping the compability to the wxpython GUI, in order to 
> be able to run the python scripts inside GRASS.
> 
> 
> Does anybody know an easier solution?

Delete the copy of Python that's bundled with GRASS, and add the
necessary packages to your system Python. IIRC, you need wxPython,
PyWin32, and NumPy.

If you have multiple versions of Python installed, the "system" Python
is the one associated with the ".py" extension; use "ftype python.file"
from the command prompt to find out which one this is.

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


More information about the grass-user mailing list