I'm trying to use GRASS on python 2.7, but I'm having some problems at setting my script on IDLE, then I'm getting an error at parser()
function:
Here is my script:
import os
import sys
gisbase = os.environ['GISBASE'] = 'C:\Program Files (x86)\GRASS GIS 7.0.1RC1'
gisrc = 'C:\grassdata'
gisdbase = 'C:\grassdata'
location = 'newLocation'
mapset = 'TC'
LD_LIBRARY_PATH = 'C:\Program Files (x86)\GRASS GIS 7.0.1RC1\lib'
PATH = 'C:\Program Files (x86)\GRASS GIS 7.0.1RC1\etc';'C:\Program Files (x86)\GRASS GIS 7.0.1RC1\etc\python';'C:\Program Files (x86)\GRASS GIS 7.0.1RC1\lib';'C:\Program Files (x86)\GRASS GIS 7.0.1RC1\bin';'C:\Python27';'C:\Program Files (x86)\GRASS GIS 7.0.1RC1\Python27';'C:\Program Files (x86)\GRASS GIS 7.0.1RC1\msys'
PYTHONLIB = 'C:\Python27'
PYTHONPATH = 'C:\Program Files (x86)\GRASS GIS 7.0.1RC1\etc\python'
sys.path.append(os.path.join(os.environ['GISBASE'], 'etc', 'python'))
import grass.script as grass
grass.parser() #I'M STUCKING HERE
I'm getting an error inside subprocess.py
:
p = subprocess.Popen([prog, '-n'] + argv, stdout=subprocess.PIPE)
The full error:
Traceback (most recent call last):
File "C:\Users\Ciro\Desktop\teste_grass.py", line 19, in <module>
grass.parser()
File "C:\Program Files (x86)\GRASS GIS 7.0.1RC1\etc\python\grass\script\core.py", line 680, in parser
p = subprocess.Popen([prog, '-n'] + argv, stdout=subprocess.PIPE)
File "C:\Python27\ArcGIS10.1\lib\subprocess.py", line 679, in __init__
errread, errwrite)
File "C:\Python27\ArcGIS10.1\lib\subprocess.py", line 893, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
What am I missing?