[GRASS-user] Problem importing grass.script python module on Windows
Pierre Racine
Pierre.Racine at sbf.ulaval.ca
Thu Jan 27 10:06:16 EST 2011
Hi,
I want to write some a GRASS geoprocessing script in Python. However Python crashes at the first line when importing the grass scripting module:
from grass.script import *
>>> Unhandled exception while debugging...
Traceback (most recent call last):
File "D:\clients\AlainPaquette\AnalyseDeCimeGRASS\CrownDelineator01.py", line 1, in <module>
from grass.script import *
File "C:\Program Files\GRASS-64\etc\python\grass\script\__init__.py", line 1, in <module>
from core import *
File "C:\Program Files\GRASS-64\etc\python\grass\script\core.py", line 867, in <module>
debug_level = int(gisenv().get('DEBUG', 0))
File "C:\Program Files\GRASS-64\etc\python\grass\script\core.py", line 505, in gisenv
s = read_command("g.gisenv", flags='n')
File "C:\Program Files\GRASS-64\etc\python\grass\script\core.py", line 216, in read_command
ps = pipe_command(*args, **kwargs)
File "C:\Program Files\GRASS-64\etc\python\grass\script\core.py", line 193, in pipe_command
return start_command(*args, **kwargs)
File "C:\Program Files\GRASS-64\etc\python\grass\script\core.py", line 155, in start_command
return Popen(args, **popts)
File "C:\Program Files\GRASS-64\etc\python\grass\script\core.py", line 53, in __init__
startupinfo, creationflags)
File "C:\Program Files\GRASS-64\Python25\lib\subprocess.py", line 587, in __init__
errread, errwrite) = self._get_handles(stdin, stdout, stderr)
File "C:\Program Files\GRASS-64\Python25\lib\subprocess.py", line 700, in _get_handles
p2cread = self._make_inheritable(p2cread)
File "C:\Program Files\GRASS-64\Python25\lib\subprocess.py", line 745, in _make_inheritable
DUPLICATE_SAME_ACCESS)
WindowsError: (6, 'Descripteur non valide')
[Dbg]>>>
I used GRASS 6.4, Windows XP, PythonWin
Any idea?
Thanks,
Pierre
More information about the grass-user
mailing list