[GRASS-dev] No module named grass.script

Vaclav Petras wenzeslaus at gmail.com
Mon Feb 10 05:50:09 PST 2020


Hi Zoltan,

On Sun, Feb 9, 2020 at 8:15 AM Zoltan Szecsei <zoltans at geograph.co.za>
wrote:

>
> set
> PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\grass\grass78\etc\python\grass
>

The path needs to be just to ...\etc\python, grass is already the package
name (you can examine the directory to see if there is __init__.py file.

There are different approaches to this. Modification of what you are doing
is here, trying to get the path from GRASS GIS executable (here just
`grass`):

https://github.com/wenzeslaus/try-grass-in-jupyter/blob/master/notebook.ipynb

Another one is grass-session/grass_session:

https://grasswiki.osgeo.org/wiki/Working_with_GRASS_without_starting_it_explicitly#Python:_GRASS_GIS_7_with_an_external_library:_grass-session

HTH,
Vaclav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20200210/25096659/attachment.html>


More information about the grass-dev mailing list