[GRASS-dev] No module named grass.script

Markus Neteler neteler at osgeo.org
Mon Feb 10 14:11:31 PST 2020


Hi,

On Mon, Feb 10, 2020 at 2:50 PM Vaclav Petras <wenzeslaus at gmail.com> wrote:
>
> 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


Once figured out, please add some notes here:

https://grasswiki.osgeo.org/wiki/Tools_for_Python_programming#PyCharm_IDE

Thanks,
Markus


More information about the grass-dev mailing list