I am trying to run GRASS GIS 7.4.0 in Spyder (Python 2.7) - Windows 10

The simple code I am trying to run is as follows:

import os
import sys

GISBASE = os.environ['GISBASE'] = 'C:\\Program Files\\GRASS GIS 7.4.0' 
GRASS_PYTHON = os.environ['GRASS_PYTHON'] = 
PYTHONHOME = os.environ['PYTHONHOME'] = os.path.join(GISBASE,'Python27')

os.environ['PATH']+=os.pathsep +os.path.join(GISBASE,'extrabin')
os.environ['PATH']+=os.pathsep +os.path.join(GISBASE,'bin')
os.environ['PATH']+=os.pathsep +os.path.join(GISBASE,'lib')
LD_LIBRARY_PATH= os.environ['LD_LIBRARY_PATH'] = os.path.join(GISBASE,'lib')

gisdb = os.path.join(os.path.expanduser("~"), "grassdata")
location = "reservoir"
mapset = "PERMANENT"

grass_pydir = os.path.join(GISBASE, "etc", "python")

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

rcfile = gsetup.init(GISBASE, gisdb, location, mapset)

gscript.run_command('r.in.gdal', input = file_path1, output = 'Hydroshed')
# gscript.run_command('g.region', raster = file_path1)

I am unable to run any gdal related commands as I get the following error:

Error 1

Error 2

EDIT: The first error was fixed by changing the names of all "sqlite.dll" files on my system. On the other hand, I could not locate any "spatialite.dll" files that could clash with my current "spatialite.dll" file.

Your Answer

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

Browse other questions tagged or ask your own question.