[GRASS-user] running grass commands in external IDE

Chad Ferguson terrafergus at gmail.com
Fri Jul 25 10:29:53 PDT 2014


I'm trying to access Grass functionality via Python outside the shell in
the GUI.

import sys, os

gisbase = os.environ['GISBASE'] = r'C:\Program Files (x86)\GRASS GIS
7.0.svn'
gisdbase = r'E:\Sample'
location = 'duplin_phons'
mapset = 'PERMANENT'


sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "python",
"grass", "script"))

import grass.script as grass
import grass.script.setup as gsetup

However when I try to run any grass commands I get

ImportError: No module named grass.script

When I'm in the shell and run

import grass.script as grass
print grass.__file__

I'm returned:
C:\Program Files (x86)\GRASS GIS 7.0.svn\etc\python\grass\script\__init__.py

Am I missing a connection somewhere?

Thanks for suggestions

Chad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20140725/6f4b0b79/attachment.html>


More information about the grass-user mailing list