Bonjour,
Comment fait-on pour utiliser Grass Dans Qgis (1.8) en python.
J'ai essaié de la façon suivante comme trouvé sur le net, mais j'ai un message d'erreur :
Merci d'avance
Comment fait-on pour utiliser Grass Dans Qgis (1.8) en python.
J'ai essaié de la façon suivante comme trouvé sur le net, mais j'ai un message d'erreur :
>>> import os
>>> import sys
>>> gisbase = os.environ['GISBASE'] = "C:/SIG/QGIS/apps/grass/grass-6.4.2"
>>> sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "python"))
>>> import grass.script
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:/SIG/QGIS/apps/qgis/./python\qgis\utils.py", line 309, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:/SIG/QGIS/apps/grass/grass-6.4.2\etc\python\grass\script\__init__.py", line 1, in <module>
from core import *
File "C:/SIG/QGIS/apps/qgis/./python\qgis\utils.py", line 309, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:/SIG/QGIS/apps/grass/grass-6.4.2\etc\python\grass\script\core.py", line 1043, in <module>
debug_level = int(gisenv().get('DEBUG', 0))
File "C:/SIG/QGIS/apps/grass/grass-6.4.2\etc\python\grass\script\core.py", line 537, in gisenv
s = read_command("g.gisenv", flags='n')
File "C:/SIG/QGIS/apps/grass/grass-6.4.2\etc\python\grass\script\core.py", line 238, in read_command
ps = pipe_command(*args, **kwargs)
File "C:/SIG/QGIS/apps/grass/grass-6.4.2\etc\python\grass\script\core.py", line 215, in pipe_command
return start_command(*args, **kwargs)
File "C:/SIG/QGIS/apps/grass/grass-6.4.2\etc\python\grass\script\core.py", line 177, in start_command
return Popen(args, **popts)
File "C:/SIG/QGIS/apps/grass/grass-6.4.2\etc\python\grass\script\core.py", line 56, in __init__
startupinfo, creationflags)
File "C:\SIG\QGIS\apps\Python27\lib\subprocess.py", line 672, in __init__
errread, errwrite) = self._get_handles(stdin, stdout, stderr)
File "C:\SIG\QGIS\apps\Python27\lib\subprocess.py", line 784, in _get_handles
p2cread = self._make_inheritable(p2cread)
File "C:\SIG\QGIS\apps\Python27\lib\subprocess.py", line 823, in _make_inheritable
_subprocess.DUPLICATE_SAME_ACCESS)
WindowsError: [Error 6] Descripteur non valide
>>>
Merci d'avance
Note du modérateur : |
![]() |