[GRASS-user] Problem with running Python script in GRASS

Glynn Clements glynn at gclements.plus.com
Thu May 6 12:02:27 EDT 2010


LeeDaniel wrote:

> I've written a Python script, doing my best to use the Python I know and
> reverse engineer the python scripts I found in the Internet. As far as I can
> tell, the script should be fine, although I naturally can't execute it
> independently. My goal is to run it as a command from inside GRASS so that
> the user can input the parameters through the GUI. I think GRASS recognizes
> that the script is there but isn't able to generate the GUI.

> After loading that into the appropriate directory:
> C:\GRASS-64\scripts
> and restarting GRASS, I enter the command "r.solar" into the command line.
> 
> The result is the following message:

> Unable to fetch interface description for command 'r.solar'.

Windows, Python and 6.4 isn't the most reliable combination.

At a minimum, you need a fairly recent version of 6.5 to be able to
use Python scripts on Windows (the hacks required to get shell scripts
to work on Windows get in the way of running other scripts). 6.4.0-RC6
won't work (g.parser was updated, but lib/python wasn't).

You also need a "clean" Python install with the correct registry
entries, and you may need to hack the GRASS startup scripts (the
WinGRASS installer fails quite badly with regard to Python, and the
OSGeo4W installer fails even harder).

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


More information about the grass-user mailing list