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

2020-08-07 Thread DAmico, Ellen


-Original Message-
From: grass-user  On Behalf Of Helmut 
Kudrnovsky
Sent: Friday, August 07, 2020 8:32 AM
To: grass-user@lists.osgeo.org
Subject: Re: [GRASS-user] Sqlite error when calling GRASS GIS outside of GRASS



>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:

[cid:image001.png@01D66C98.D8A81050]



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

[cid:image002.png@01D66C98.D8A81050]





>>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
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

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

2020-08-07 Thread DAmico, Ellen
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.

[cid:image001.png@01D66C8F.7C031BF0]



-Original Message-

From: Moritz Lennert 

Sent: Friday, August 7, 2020 5:54 AM

To: grass-user@lists.osgeo.org; DAmico, Ellen ; GRASS 
user list 

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



Hi Ellen,



Am 6. August 2020 22:03:24 MESZ schrieb "DAmico, Ellen" :

>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://gcc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgrass

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

>%40epa.gov%7C92882cdd739146e8807d08d83ab7dae1%7C88b378b367484867acf976a

>acbeca6a7%7C0%7C0%7C637323908615854246&sdata=Prpxv0th3vqxwHUsdAX1jz

>%2BntOjYb0bVZilg6X27Zgc%3D&reserved=0

>

>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://gcc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgrasswiki.osgeo.org%2Fwiki%2FWorking_with_GRASS_without_starting_it_explicitly&data=02%7C01%7CDAmico.Ellen%40epa.gov%7C92882cdd739146e8807d08d83ab7dae1%7C88b378b367484867acf976aacbeca6a7%7C0%7C0%7C637323908615854246&sdata=zV6q3w4yy8c7LjPe866SDikzTm4B3BlB%2BPnZLhaov9s%3D&reserved=0
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

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

2020-08-06 Thread DAmico, Ellen
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
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Using grass libraries in python outside of GRASS

2020-07-29 Thread DAmico, Ellen
Thank you that solved it with some tweaks.
I added GRASSBIN to my Environment variables populated with the grass bat file 
instead of GISBIN.  Then added 'lib', 'bin' and 'scripts' folders to PATH 
variable.  Once I did that that I was able to import grass_session and grass.
It appears to work fine without GISRC set.
Ellen


From: Sajid Pareeth 
Sent: Wednesday, July 29, 2020 8:10 AM
To: Markus Neteler 
Cc: DAmico, Ellen ; GRASS user list 

Subject: Re: [GRASS-user] Using grass libraries in python outside of GRASS

Hi

> > The model I need to use (which I did not write) requires python 2.7.
> > I had tried pip install previously but then it still fails with 
> > ImportError: No module named grass.script.
> > Do you know what could be causing that?

Interestingly, our docker containers just started to suffer from a
similar (same?) problem:

File "/scripts/test_grass_session.py", line 3, in 
import grass.script as grass
ModuleNotFoundError: No module named 'grass'

Weird, we need to investigate.

Grass_session works for me with both python2.7 and 3 in a Osgeo environment 
with grass 7.8.3
For me, the import modules work in this order in both python versions after pip 
installation.

>>> import grass_session
>>> from grass_session import Session
>>> import grass.script as grass

For the final script to work, you will have to set environment variables, 
GISBIN (grass78 root folder) , GISRC (.grassrc78 file in demo location) and add 
grass78 'lib', 'bin' and 'scripts' folders to PATH variable.
I run the script in python 3, where it worked without setting GISBIN and GISRC 
variables. I have only tested this approach in Windows 10 yet, and should work 
fine in Linux as well.

Regards

Sajid


___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Using grass libraries in python outside of GRASS

2020-07-29 Thread DAmico, Ellen
Interesting.  I will await anything you find.   Thank you.  Ellen

-Original Message-
From: Markus Neteler  
Sent: Wednesday, July 29, 2020 4:01 AM
To: DAmico, Ellen 
Cc: GRASS user list 
Subject: Re: [GRASS-user] Using grass libraries in python outside of GRASS

On Tue, Jul 28, 2020 at 10:27 PM Markus Neteler  wrote:
> On Tue, Jul 28, 2020 at 9:17 PM DAmico, Ellen  wrote:
...
> > The model I need to use (which I did not write) requires python 2.7.
> > I had tried pip install previously but then it still fails with 
> > ImportError: No module named grass.script.
> > Do you know what could be causing that?

Interestingly, our docker containers just started to suffer from a similar 
(same?) problem:

File "/scripts/test_grass_session.py", line 3, in  import grass.script 
as grass
ModuleNotFoundError: No module named 'grass'

Weird, we need to investigate.

Markus

> Perhaps simply a PYTHONPATH issue?
> At the bottom of this page there are some examples:
>
> https://gcc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith
> ub.com%2Fzarch%2Fgrass-session%2Fblob%2Fmaster%2FREADME.rst&data=0
> 2%7C01%7CDAmico.Ellen%40epa.gov%7C6e81e6c4acc84db1340008d833959e0f%7C8
> 8b378b367484867acf976aacbeca6a7%7C0%7C0%7C637316064983993601&sdata
> =bPE1zELFkkj3HpVVopBH7a6nPpAdRK%2BdC2Tj1h4hdIs%3D&reserved=0
>
> Markus



--
Markus Neteler, PhD
https://gcc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.mundialis.de%2F&data=02%7C01%7CDAmico.Ellen%40epa.gov%7C6e81e6c4acc84db1340008d833959e0f%7C88b378b367484867acf976aacbeca6a7%7C0%7C0%7C637316064983993601&sdata=I6CFUA2PPoaFwdRImG24FuTsIUsOuqwtzxF%2Fy3nV0B8%3D&reserved=0
 - free data with free software
https://gcc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgrass.osgeo.org%2F&data=02%7C01%7CDAmico.Ellen%40epa.gov%7C6e81e6c4acc84db1340008d833959e0f%7C88b378b367484867acf976aacbeca6a7%7C0%7C0%7C637316064983993601&sdata=gnL1xIhAsTEfJznQqT%2BMUkVYBPXZArIMFvz5Y%2FeLM2U%3D&reserved=0
https://gcc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcourses.neteler.org%2Fblog&data=02%7C01%7CDAmico.Ellen%40epa.gov%7C6e81e6c4acc84db1340008d833959e0f%7C88b378b367484867acf976aacbeca6a7%7C0%7C0%7C637316064983993601&sdata=X6lnIHt7PAJEc2pO0mixaTNicoCBBcoTJdezpJ%2BfFTg%3D&reserved=0
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Using grass libraries in python outside of GRASS

2020-07-28 Thread DAmico, Ellen
Thanks.  Those links go to the same place are they supposed to? I will take a 
deeper look tomorrow.  I appreciate your help.


-Original Message-
From: Markus Neteler  
Sent: Tuesday, July 28, 2020 4:28 PM
To: DAmico, Ellen 
Cc: GRASS user list 
Subject: Re: [GRASS-user] Using grass libraries in python outside of GRASS

(please keep the list in cc)

On Tue, Jul 28, 2020 at 9:17 PM DAmico, Ellen  wrote:
>
> Thanks for the quick response.  Does that work with both python 2.7 and 3?

Honestly, I don't know but you may want to verify here:

https://gcc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fzarch%2Fgrass-session&data=02%7C01%7CDAmico.Ellen%40epa.gov%7C9388b82c13c34de0343308d83334bb71%7C88b378b367484867acf976aacbeca6a7%7C0%7C0%7C637315648877416940&sdata=CLnQvLXXt5zuqSCAUj6T4d3TnmhdTAbmYj10e%2B%2BiwJ4%3D&reserved=0

> The model I need to use (which I did not write) requires python 2.7.
> I had tried pip install previously but then it still fails with ImportError: 
> No module named grass.script.
> Do you know what could be causing that?

Perhaps simply a PYTHONPATH issue?
At the bottom of this page there are some examples:

https://gcc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fzarch%2Fgrass-session%2Fblob%2Fmaster%2FREADME.rst&data=02%7C01%7CDAmico.Ellen%40epa.gov%7C9388b82c13c34de0343308d83334bb71%7C88b378b367484867acf976aacbeca6a7%7C0%7C0%7C637315648877416940&sdata=Js%2BAvHd8J65XPqEl3EDfWF9fIq%2F3UZJHG3S9KhC4NLg%3D&reserved=0

Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] Using grass libraries in python outside of GRASS

2020-07-28 Thread DAmico, Ellen
Hi,
I may be missing something very simple here.  Is there a way to access the 
GRASS python libraries outside of the GRASS GUI without calling python through 
GRASS.  I built  a python environment (in Anaconda) that is setup with other 
libraries that are required for a model I need to run.  I would like to be able 
to call the GRASS libraries in that custom environment.
Thanks.
Ellen

Ellen D'Amico, GISP
GIS Specialist
Pegasus Technical Services c/o US EPA
26 W. Martin Luther King Dr.
Cincinnati, OH 45268
513-569-7167

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Grass GIS and McAfee

2019-05-07 Thread DAmico, Ellen
Thanks for the suggestions.  Unfortunately I do not have a choice in virus 
checkers, my work requires McAfee.  I am working with McAfee on a resolution.  
They have been responsive but no solution yet.

From: Francois Chartier 
Sent: Tuesday, May 07, 2019 9:11 AM
To: Markus Neteler 
Cc: DAmico, Ellen ; GRASS user list 

Subject: Re: [GRASS-user] Grass GIS and McAfee

use Avast,  it will run a scan when u use a new module or when upgrading to a 
newer version of grass, however after first scan it will run it.

On Tue., May 7, 2019, 01:25 Markus Neteler, 
mailto:nete...@osgeo.org>> wrote:
Hi Ellen,
DAmico, Ellen mailto:damico.el...@epa.gov>> schrieb am 
Mi., 17. Apr. 2019, 14:55:
Good Morning,
I am new to GRASS.  I am using it in command line.  I have discovered that my 
McAfee virus checker is seeing some of the GRASS .bat files as suspicious and 
obviously will not run them.  In particular this file (db.in.ogr.bat).  McAfee 
doesn’t like the fact it has multiple “.”  I was wondering if anyone else has 
run into this issue and what their solution to it was.  I CANNOT disable 
McAfee.  The agency I work for would frown upon that.

The only way I see is to contact their support. Maybe you have already done 
that?

Best
Markus

Thank you.
Ellen


___
grass-user mailing list
grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

[GRASS-user] Grass GIS and McAfee

2019-04-17 Thread DAmico, Ellen
Good Morning,
I am new to GRASS.  I am using it in command line.  I have discovered that my 
McAfee virus checker is seeing some of the GRASS .bat files as suspicious and 
obviously will not run them.  In particular this file (db.in.ogr.bat).  McAfee 
doesn't like the fact it has multiple "."  I was wondering if anyone else has 
run into this issue and what their solution to it was.  I CANNOT disable 
McAfee.  The agency I work for would frown upon that.
Thank you.
Ellen


___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user