[GRASS-user] Python scripts: 'command not found'

Nikos Alexandris nikos.alexandris at felis.uni-freiburg.de
Thu Aug 19 09:42:12 EDT 2010


On Thursday 19 of August 2010 15:13:37 Hanlie Pretorius wrote:

> I'm working in GRASS 6.4RC6 on Ubuntu 10.04 and I'm trying to learn
> how to script GRASS using Python.
> 
> I have taken the example at
> http://grass.osgeo.org/programming6/pythonlib.html that checks if a
> vector is 3D and saved it to my home folder. When I try to run it
> though, GRASS can't find the file:
> 
> -----
> GRASS 6.4.0RC6 (sa_wgs84):~ > ls *.py
> check_3d.py  proxy.py
> GRASS 6.4.0RC6 (sa_wgs84):~ > check_3d.py
> check_3d.py: command not found
> ----

Try "python check_3d.py" or copy the script under the "scripts" directory in 
your local grass installation (somethin' lke 
"/usr/local/grass-6.4.0svn/scripts").
 
> I also tried placing the script in the GRASS scripts folder using the
> name 'v.check3d' and got the following errors:

A, ok! You already did that. 

> -----
> GRASS 6.4.0RC6 (sa_wgs84):~ > v.check3d
> bash: /usr/lib/grass64/scripts/v.check3d: Permission denied
> GRASS 6.4.0RC6 (sa_wgs84):~ > sudo v.check3d
> [sudo] password for hanlie:
> sudo: v.check3d: command not found
> -----

Better not to use sudo (as a general advice). The script needs to be made 
executable for your user-name, i.e.:

sudo chown hanlie:hanlie  v.check3d

Hope this helps, Nikos


More information about the grass-user mailing list