Search code examples
pythonspatialitegrass

GRASS r.in.gdal crash:procedure entry point sqlite3_rtree_geometry_callback could not be located in the dynamic link library spatialite.dll


I wrote the following python script to try to import a raster file into GRASS:

import os
os.chdir(r'C:\Users\Desktop')
import sys
sys.path.append(os.path.join(os.environ['GISBASE'], 'etc', 'python'))
import grass.script as g
import grass.script.setup as gsetup
gisbase = os.environ['GISBASE']
gisdb = 'C:\Users\Documents\grassdata'
location = 'newLocation'
mapset = 'mTW'
gsetup.init(gisbase, gisdb, location, mapset)

g.run_command('r.in.gdal', input = 'middle TW', output = 'middl_TW')

But I got this error:

ERROR: GISRC - variable not set

And then this box message showed up:

enter image description here

It means that the procedure entry point sqlite3_rtree_geometry_callback could not be located in the dynamic link library C:\OSGeo4W\bin\spatialite.dll

And then this showed up:

enter image description here

Seems that the r.in.gdal module crashed just as I called it.

If I directly use GRASS GUI, this box message showed up and the program crashed after I choose one mapset:

enter image description here

How to solve this problem? I am using GRASS 6.4.3, python 2.7.6 under WIN 8.1


Solution

  • After I uninstalled OSGEO4W by deleting its whole folder under C:\OSGEO4W, now I can launch GRASS and use its module normally.