[GRASS-user] Running a python script using GRASS GIS on a Mac

Shaffiq Somani ssomani at msn.com
Mon Nov 22 19:55:41 PST 2021

Dear GRASS Community,

I did find this previous exchange, that someone has asked the same question before.


The sudo easy install pip doesn’t really work since since there is no Python version 2.7

I did the remaining steps as shown below and this is the message I received.

3) Please note there is an updated python script, that doesn’t have a name but I name it to a.py.  The updated is displayed using the following link.  I updated the print command by adding ()

Now I am not sure where to go next.

Any help you can provide would greatly be appreciated.  Thanks.

Kind Regards,


On Nov 21, 2021, at 5:48 PM, Shaffiq Somani <ssomani at msn.com<mailto:ssomani at msn.com>> wrote:

Dear GRASS Community,

I am trying to run grass as a Python script  for the gapfilling component of PySEBAL where the GitHub directory is shown below.   I have already imported the grass-session using the pip3 command.

PySEBAL GitHub Directory GapFilling

The Windows Environmental Variable setup file is shown below which I tried to follow in the  Jupyter Notebook and  see if I can import GRASS.  Unfortunately, I had no luck as shown in the screenshot.

set GRASSBIN=C:\OSGeo4W64\bin\grass78
set GISRC=C:\OSGeo4W64\apps\grass\grass78\demolocation\.grassrc78
set PATH=%PATH%;C:\OSGeo4W64\apps\grass\grass78\lib;C:\OSGeo4W64\apps\grass\grass78\bin;C:\OSGeo4W64\apps\grass\grass78\scripts

Does anyone have ideas or suggestions on how to make GRASS GIS run on  the MacOS so I can make the gap fill_v3.py work with minimum alteration for the file.   I have seen a few suggestions, on trying to make grass run via python, but I have not had any luck.  .  Any help you can provide or point me too in the right direction would be greatly appreciated.


Kind Regards,


<Screen Shot 2021-11-21 at 5.07.03 PM.png>
grass-user mailing list
grass-user at lists.osgeo.org<mailto:grass-user at lists.osgeo.org>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20211123/c4225056/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-1.png
Type: image/png
Size: 257089 bytes
Desc: PastedGraphic-1.png
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20211123/c4225056/attachment-0001.png>

More information about the grass-user mailing list