[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.

https://www.mail-archive.com/grass-user@lists.osgeo.org/msg36682.html

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.
[cid:EBE80624-E03D-4FF0-804A-474436BDFB5F]



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 ()
https://www.mail-archive.com/grass-user@lists.osgeo.org/msg36683.html

Now I am not sure where to go next.

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

Kind Regards,

Shaffiq



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
https://github.com/spareeth/PySEBAL_dev/tree/version3.7.3/gapfilling<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fspareeth%2FPySEBAL_dev%2Ftree%2Fversion3.7.3%2Fgapfilling&data=04%7C01%7C%7Cb3e3347ca584491da59308d9ad495f77%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637731352914490210%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Eit62SvS5vmUmmO5rn3Y7PyAs1lEZcFINetngvrNIAw%3D&reserved=0>

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.

Thanks.

Kind Regards,

Shaffiq



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

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