[GRASS-user] Trying to use GRASS with Jupyter note books in Windows

Vishal Mehta vishalm1975 at gmail.com
Thu Sep 28 13:07:14 PDT 2023


Thanks Markus and Vaclav,

This is what worked for me on Windows:
# Ask GRASS GIS where its Python packages are.
sys.path.append(
    subprocess.check_output(["C:\GRASS GIS 8.3/grass83.bat", "--config",
"python_path"], text=True).strip()
)

Also, can I use bash within the jupyter notebook? I'm not familiar with the
gs.script syntax; I'm very comfortable with the old bash ways..
so any day I would rather
glist rast than
gs.list_grouped(type=['raster'])

What i'm hoping for is a way to mix and match within a single workflow,
taking advantage of things like the interactive map via python
what-have-you's, but sticking to the bash commands for pretty much
everything else.

I saw some notebooks with something like
%%bash
<some bash commands>

but that didn't work for me..

Thanks,
Vishal





On Thu, Sep 28, 2023 at 12:46 AM Markus Neteler <neteler at osgeo.org> wrote:

> On Thu, Sep 28, 2023 at 5:22 AM Vaclav Petras via grass-user
> <grass-user at lists.osgeo.org> wrote:
> >
> > Hi Vishal,
> >
> > The executable on Windows is not called "grass" like on Linux but
> "grass8" or "grass83" (to avoid a strange Python
> > import error). That should do the trick. If not, try simply providing a
> full path yourself including the extension (C:\...\...bat).
>
> I have taken liberty to cite this note here:
>
> https://grasswiki.osgeo.org/wiki/GRASS_GIS_Jupyter_notebooks#Windows_tricks
>
> Best,
> Markus
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20230928/d0e99363/attachment.htm>


More information about the grass-user mailing list