1

I have added this add on with g.extension on my grass 6.4.3RC3. But it doesnt work... this is the error I can see:

Traceback (most recent call last): File "C:\Program Files (x86)\GRASS GIS 6.4.3RC3\etc\wxpython\gui_core\prompt.py", line 839, in OnItemSelected

self.cmdDesc = gtask.parse_interface(GetRealCmd(cmd)) File "C:\Program Files (x86)\GRASS GIS 6.4.3RC3\etc\python\grass\script\task.py", line 470, in parse_interface

tree = etree.fromstring(get_interface_description(name)) File "C:\Program Files (x86)\GRASS GIS 6.4.3RC3\etc\python\grass\script\task.py", line 448, in get_interface_description

"\n\nDetails: %(det)s") % { 'cmd' : cmd, 'det' : decode(cmderr) } grass.script.core . ScriptError : Unable to fetch interface description for command 'r.basin.py.bat'. Details: C:/Program Files (x86)/GRASS GIS 6.4.3RC3/scripts/r.basin.py: line 74: import: command not found C:/Program Files (x86)/GRASS GIS 6.4.3RC3/scripts/r.basin.py: line 75: import: command not found C:/Program Files (x86)/GRASS GIS 6.4.3RC3/scripts/r.basin.py: line 76: import: command not found C:/Program Files (x86)/GRASS GIS 6.4.3RC3/scripts/r.basin.py: line 77: import: command not found C:/Program Files (x86)/GRASS GIS 6.4.3RC3/scripts/r.basin.py: line 78: from: command not found C:/Program Files (x86)/GRASS GIS 6.4.3RC3/scripts/r.basin.py: line 79: from: command not found C:/Program Files (x86)/GRASS GIS 6.4.3RC3/scripts/r.basin.py: line 80: import: command not found C:/Program Files (x86)/GRASS GIS 6.4.3RC3/scripts/r.basin.py: line 82: syntax error near unexpected token (' C:/Program Files (x86)/GRASS GIS 6.4.3RC3/scripts/r.basin.py: line 82:if not os.environ.has_key("GISBASE"):'

can someone help me? thanks

1

It sounds like Python is not installed or *.py files are not assocaited with the interpreter.

Just so you learn something new and possible fix it yourself next time: If you go and open up the Python script file in question r.basin.py located for you in C:/Program Files (x86)/GRASS GIS 6.4.3RC3/scripts/

And then find lines in question at the most recent call, which are at the bottom. Stack traces in Python are more recent at the bottom.

Code in question line 74 - 84:

import sys
import os
import grass.script as grass
import math
from numpy import array
from numpy import zeros
import csv

if not os.environ.has_key("GISBASE"):
    grass.message( "You must be in GRASS GIS to run this program." )
    sys.exit(1)

All of this lines are imports from the Python Standard Library. It is NOT saying the module cannot be found, it is saying that import, from cannot be found and the if statement is bad syntax. This hints that it cannot find the python interpreter and is trying to run the script file natively.

To hopefully fix this: Right-click r.basin.py and select Open With, choose Choose Default Program... and finally select python.exe from the list. Also, make sure the box at the bottom is check that states, Always use the selected program to open this kind of file.

I hope this helps you.

  • Thank you RomaH, it sounds easy. I will try, and I hope to fix it. I'm quite new as you can see. – mattrx86 Jun 6 '13 at 6:22
  • ok, I tried. This is the new script error: Unable to fetch interface description for command 'r.basin.py.bat'. Details: "C:/Program Files (x86)/GRASS GIS 6.4.3RC3/msys/bin/sh.exe": C:/Program Files (x86)/GRASS GIS 6.4.3RC3/scripts/r.basin.py: No such file or directory – mattrx86 Jun 6 '13 at 6:53
  • Sorry for the long-overdue reply Matt. Check those paths and make sure those files exist. My setup is a little different and I usually use Linux, so I cannot test along side. – RomaH Jun 13 '13 at 14:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.