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

DAmico, Ellen DAmico.Ellen at epa.gov
Tue Jul 28 13:48:05 PDT 2020


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 <neteler at osgeo.org> 
Sent: Tuesday, July 28, 2020 4:28 PM
To: DAmico, Ellen <DAmico.Ellen at epa.gov>
Cc: GRASS user list <grass-user at lists.osgeo.org>
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 <DAmico.Ellen at epa.gov> 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


More information about the grass-user mailing list