[GRASS-user] Sqlite error when calling GRASS GIS outside of GRASS

Good Afternoon,

I have been going around in circles with this error.

When I run this piece of code:

g.run_command(r’C:\OSGeo4W64\apps\grass\grass78\bin\g.proj.exe’, georef=geotiff, location = locationGeonet)

I am getting this error:

Process ended with non-zero return code 3221225785. See errors in the (error)

When I run that g.proj.exe directly I get the dynamic link error.

I think this is a conflict with the sqlite3.dll as is suggested the below wiki but the solutions there have not worked for me.

https://grasswiki.osgeo.org/wiki/WinGRASS_errors

I am wondering if it might have something to do with not having administrative rights to my machine. I can access my path variables through Spyder/ Anaconda but not directly through the usual channels. I am on a windows machine.

Thanks again for any help.

Ellen

Hi Ellen,

Am 6. August 2020 22:03:24 MESZ schrieb "DAmico, Ellen" <DAmico.Ellen@epa.gov>:

Good Afternoon,
I have been going around in circles with this error.
When I run this piece of code:
g.run_command(r'C:\OSGeo4W64\apps\grass\grass78\bin\g.proj.exe',
georef=geotiff, location = locationGeonet)
I am getting this error:
Process ended with non-zero return code 3221225785. See errors in the
(error)

When I run that g.proj.exe directly I get the dynamic link error.

I think this is a conflict with the sqlite3.dll as is suggested the
below wiki but the solutions there have not worked for me.
https://grasswiki.osgeo.org/wiki/WinGRASS_errors

I am wondering if it might have something to do with not having
administrative rights to my machine. I can access my path variables
through Spyder/ Anaconda but not directly through the usual channels.
I am on a windows machine.

First of all, there are a series of variables you have to define before you can call a module without starting GRASS GIS explicitly. See [1] or use the exec parameter of the grass command.

Second, when using the functions in the grass scripting library (e.g. run_command), you should not provide a path, but just the module name, i.e.

g.run_command('g.proj', georef=geotiff, location = locationGeonet)

Moritz

[1] https://grasswiki.osgeo.org/wiki/Working_with_GRASS_without_starting_it_explicitly

Hi,

Thanks for the suggestions. I do have the paths set up. Like I said I can only set these through Spyder and not in my path variables directly because I do not have admin privileges to my work machine, I am not sure if this causing problems or not.

If you can give me an example of how you set up the GISRC that might be helpful because perhaps I don’t have that set up properly.

I have run through the link you have sent several times already. I was able to run all of the python example codes successfully, except the one for using pygrass. I think would suggest that I don’t have the path set up for the library set properly.

I also tried your suggestion about removing the path from the module name. That gave me the exact same error so that is not the issue.

Here is how I have the other paths set up.

I am getting this error:

Process ended with non-zero return code 3221225785. See errors in the

(error)

it's a dll mixing/mismatch due to more of the same dll in your %PATH%.

which library errored the message above? (sqlite? gdal?)

g.run_command(r'C:\OSGeo4W64\apps\grass\grass78\bin\g.proj.exe',

georef=geotiff, location = >locationGeonet)

really an unusual way to invoke g.proj. never saw this working.

I think this is a conflict with the sqlite3.dll as is suggested the below

wiki but the solutions there have >not worked for me.

https://grasswiki.osgeo.org/wiki/WinGRASS_errors

which solutions did you try?

just open a normal windows console and type:

C:\Users\yourusername>where "$path:sqlite3*"

it's checking sqlite3 in your %PATH%

report back in your case.

when I open the OSGeo4W shell, I get

C:\>where "$path:sqlite3*"
C:\Program Files\QGIS 3.4\bin\sqlite3.dll
C:\Program Files\QGIS 3.4\bin\sqlite3.exe

is there a windows console availabe in the Spyder/ Anaconda framework? if
yes, then type where "$path:sqlite3*" and report back.

have you seen:

https://github.com/OSGeo/grass/issues/679

?

and the mentioned thread:

https://stackoverflow.com/questions/53682315/error-on-libcurl-dll-when-using-gdal-of-osgeo4w-in-django

-----
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Users-f3884509.html

I am getting this error:

Process ended with non-zero return code 3221225785. See errors in the

(error)

it’s a dll mixing/mismatch due to more of the same dll in your %PATH%.

I went through as suggested and excluded the sqlite dlls found and that did not help.

which library errored the message above? (sqlite? gdal?)

The library that errored is sqlite.

g.run_command(r’C:\OSGeo4W64\apps\grass\grass78\bin\g.proj.exe’,

georef=geotiff, location = >locationGeonet)

really an unusual way to invoke g.proj. never saw this working.

I am trying to get a model that I did NOT write to work this is how they do it. Perhaps there is a better way.

I think this is a conflict with the sqlite3.dll as is suggested the

below

wiki but the solutions there have >not worked for me.

https://gcc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgrass

wiki.osgeo.org%2Fwiki%2FWinGRASS_errors&data=02%7C01%7CDAmico.Ellen

%40epa.gov%7Ce28ddeb63b4e45dced4d08d83acde1bd%7C88b378b367484867acf976a

acbeca6a7%7C0%7C0%7C637324003812775461&sdata=s8uZGsVa%2Fif7EKaoiBhz

pBx8Wy5OpIZRlWcQ8F1mjpQ%3D&reserved=0

which solutions did you try?

I tried everything suggested in the link for #1 and #16 which are both about sqlite conflicts.

just open a normal windows console and type:

C:\Users\yourusername>where “$path:sqlite3*”

it’s checking sqlite3 in your %PATH%

report back in your case.

I checked out the dll’s previously following the original link I sent with my question. I tried to do the one by one exclusion and none helped.

When I run the where from the windows console I get this:

When I do it from the OSGGeo4W Shell. I get this:

when I open the OSGeo4W shell, I get

C:>where “$path:sqlite3*”

C:\Program Files\QGIS 3.4\bin\sqlite3.dll C:\Program Files\QGIS 3.4\bin\sqlite3.exe

is there a windows console availabe in the Spyder/ Anaconda framework? if yes, then type where “$path:sqlite3*” and report back.

There is not.

have you seen:

https://gcc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FOSGeo%2Fgrass%2Fissues%2F679&data=02%7C01%7CDAmico.Ellen%40epa.gov%7Ce28ddeb63b4e45dced4d08d83acde1bd%>>7C88b378b367484867acf976aacbeca6a7%7C0%7C0%7C637324003812775461&sdata=r%2B3UD8sQn8t%2BgcXZXTR50FGRoV29QvnODiD77A1vFqY%3D&reserved=0

?

I have not. But that does seem to be my exact error. I wonder if I switch to miniconda instead of Anaconda that will help. Thanks for sending it.

and the mentioned thread:

https://gcc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F53682315%2Ferror-on-libcurl-dll-when-using-gdal-of-osgeo4w-in-django&data=02%7C01%7CDAmico.Ellen%40epa.gov%>>7Ce28ddeb63b4e45dced4d08d83acde1bd%7C88b378b367484867acf976aacbeca6a7%7C0%7C0%7C637324003812785429&sdata=AnOizoWcJzI6cY3WqhLQ42Pxx%2BSiYg2Y0PC%2FdFZgMDA%3D&reserved=0

Thank you.

Ellen

[in a windows console/osgeo4w console you can mark the content with the mouse, then press return on the keybord, then you
can paste the content as normal text into a mail, no screenshot needed}

When I run the where from the windows console I get this:

there is a sqlite dll hell caused by ArcGIS and anaconda.

kind regards
Helmut