<div dir="ltr">Thanks Markus, <div>I installed bash kernel; and it seems that it is there (#lsmagic lists bash as one of the cell magics)</div><div><br></div><div>but I get the error below:</div><div><br></div><div>##bash</div><div>g.list type=rast </div><div><br></div><div><pre style="font-size:13px;color:rgba(0,0,0,0.87);border:none;margin-top:0px;margin-bottom:0px;padding:0px;overflow:auto;word-break:break-all"><span class="gmail-ansi-red-intense-fg gmail-ansi-bold" style="color:rgb(178,43,49);font-weight:bold">---------------------------------------------------------------------------</span>
<span class="gmail-ansi-red-intense-fg gmail-ansi-bold" style="color:rgb(178,43,49);font-weight:bold">CalledProcessError</span>                        Traceback (most recent call last)
Cell <span class="gmail-ansi-green-intense-fg gmail-ansi-bold" style="color:rgb(0,116,39);font-weight:bold">In[20], line 1</span>
<span class="gmail-ansi-green-intense-fg gmail-ansi-bold" style="color:rgb(0,116,39);font-weight:bold">----> 1</span> <span class="gmail-ansi-yellow-bg" style="background-color:rgb(221,182,43)">get_ipython</span><span class="gmail-ansi-yellow-bg" style="background-color:rgb(221,182,43)">(</span><span class="gmail-ansi-yellow-bg" style="background-color:rgb(221,182,43)">)</span><span class="gmail-ansi-yellow-bg" style="background-color:rgb(221,182,43);color:rgb(98,98,98)">.</span><span class="gmail-ansi-yellow-bg" style="background-color:rgb(221,182,43)">run_cell_magic</span><span class="gmail-ansi-yellow-bg" style="background-color:rgb(221,182,43)">(</span><span class="gmail-ansi-yellow-bg" style="background-color:rgb(221,182,43);color:rgb(175,0,0)">'</span><span class="gmail-ansi-yellow-bg" style="background-color:rgb(221,182,43);color:rgb(175,0,0)">bash</span><span class="gmail-ansi-yellow-bg" style="background-color:rgb(221,182,43);color:rgb(175,0,0)">'</span><span class="gmail-ansi-yellow-bg" style="background-color:rgb(221,182,43)">,</span><span class="gmail-ansi-yellow-bg" style="background-color:rgb(221,182,43)"> </span><span class="gmail-ansi-yellow-bg" style="background-color:rgb(221,182,43);color:rgb(175,0,0)">'</span><span class="gmail-ansi-yellow-bg" style="background-color:rgb(221,182,43);color:rgb(175,0,0)">'</span><span class="gmail-ansi-yellow-bg" style="background-color:rgb(221,182,43)">,</span><span class="gmail-ansi-yellow-bg" style="background-color:rgb(221,182,43)"> </span><span class="gmail-ansi-yellow-bg" style="background-color:rgb(221,182,43);color:rgb(175,0,0)">'</span><span class="gmail-ansi-yellow-bg" style="background-color:rgb(221,182,43);color:rgb(175,0,0)">g.list rast</span><span class="gmail-ansi-yellow-bg gmail-ansi-bold" style="background-color:rgb(221,182,43);font-weight:bold;color:rgb(175,95,0)">\n</span><span class="gmail-ansi-yellow-bg" style="background-color:rgb(221,182,43);color:rgb(175,0,0)">'</span><span class="gmail-ansi-yellow-bg" style="background-color:rgb(221,182,43)">)</span>

File <span class="gmail-ansi-green-intense-fg gmail-ansi-bold" style="color:rgb(0,116,39);font-weight:bold">C:\GRASS GIS 8.3\Python39\lib\site-packages\IPython\core\interactiveshell.py:2493</span>, in <span class="gmail-ansi-cyan-fg" style="color:rgb(96,198,200)">InteractiveShell.run_cell_magic</span><span class="gmail-ansi-blue-intense-fg gmail-ansi-bold" style="color:rgb(0,101,202);font-weight:bold">(self, magic_name, line, cell)</span>
<span class="gmail-ansi-green-fg" style="color:rgb(0,162,80)">   2491</span> <span class="gmail-ansi-bold" style="font-weight:bold;color:rgb(0,135,0)">with</span> <span style="color:rgb(0,135,0)">self</span><span style="color:rgb(98,98,98)">.</span>builtin_trap:
<span class="gmail-ansi-green-fg" style="color:rgb(0,162,80)">   2492</span>     args <span style="color:rgb(98,98,98)">=</span> (magic_arg_s, cell)
<span class="gmail-ansi-green-intense-fg gmail-ansi-bold" style="color:rgb(0,116,39);font-weight:bold">-> 2493</span>     result <span style="color:rgb(98,98,98)">=</span> fn(<span style="color:rgb(98,98,98)">*</span>args, <span style="color:rgb(98,98,98)">*</span><span style="color:rgb(98,98,98)">*</span>kwargs)
<span class="gmail-ansi-green-fg" style="color:rgb(0,162,80)">   2495</span> <span style="color:rgb(95,135,135)"># The code below prevents the output from being displayed</span>
<span class="gmail-ansi-green-fg" style="color:rgb(0,162,80)">   2496</span> <span style="color:rgb(95,135,135)"># when using magics with decorator @output_can_be_silenced</span>
<span class="gmail-ansi-green-fg" style="color:rgb(0,162,80)">   2497</span> <span style="color:rgb(95,135,135)"># when the last Python token in the expression is a ';'.</span>
<span class="gmail-ansi-green-fg" style="color:rgb(0,162,80)">   2498</span> <span class="gmail-ansi-bold" style="font-weight:bold;color:rgb(0,135,0)">if</span> <span style="color:rgb(0,135,0)">getattr</span>(fn, magic<span style="color:rgb(98,98,98)">.</span>MAGIC_OUTPUT_CAN_BE_SILENCED, <span class="gmail-ansi-bold" style="font-weight:bold;color:rgb(0,135,0)">False</span>):

File <span class="gmail-ansi-green-intense-fg gmail-ansi-bold" style="color:rgb(0,116,39);font-weight:bold">C:\GRASS GIS 8.3\Python39\lib\site-packages\IPython\core\magics\script.py:154</span>, in <span class="gmail-ansi-cyan-fg" style="color:rgb(96,198,200)">ScriptMagics._make_script_magic.<locals>.named_script_magic</span><span class="gmail-ansi-blue-intense-fg gmail-ansi-bold" style="color:rgb(0,101,202);font-weight:bold">(line, cell)</span>
<span class="gmail-ansi-green-fg" style="color:rgb(0,162,80)">    152</span> <span class="gmail-ansi-bold" style="font-weight:bold;color:rgb(0,135,0)">else</span>:
<span class="gmail-ansi-green-fg" style="color:rgb(0,162,80)">    153</span>     line <span style="color:rgb(98,98,98)">=</span> script
<span class="gmail-ansi-green-intense-fg gmail-ansi-bold" style="color:rgb(0,116,39);font-weight:bold">--> 154</span> <span class="gmail-ansi-bold" style="font-weight:bold;color:rgb(0,135,0)">return</span> <span class="gmail-ansi-yellow-bg" style="background-color:rgb(221,182,43);color:rgb(0,135,0)">self</span><span class="gmail-ansi-yellow-bg" style="background-color:rgb(221,182,43);color:rgb(98,98,98)">.</span><span class="gmail-ansi-yellow-bg" style="background-color:rgb(221,182,43)">shebang</span><span class="gmail-ansi-yellow-bg" style="background-color:rgb(221,182,43)">(</span><span class="gmail-ansi-yellow-bg" style="background-color:rgb(221,182,43)">line</span><span class="gmail-ansi-yellow-bg" style="background-color:rgb(221,182,43)">,</span><span class="gmail-ansi-yellow-bg" style="background-color:rgb(221,182,43)"> </span><span class="gmail-ansi-yellow-bg" style="background-color:rgb(221,182,43)">cell</span><span class="gmail-ansi-yellow-bg" style="background-color:rgb(221,182,43)">)</span>

File <span class="gmail-ansi-green-intense-fg gmail-ansi-bold" style="color:rgb(0,116,39);font-weight:bold">C:\GRASS GIS 8.3\Python39\lib\site-packages\IPython\core\magics\script.py:314</span>, in <span class="gmail-ansi-cyan-fg" style="color:rgb(96,198,200)">ScriptMagics.shebang</span><span class="gmail-ansi-blue-intense-fg gmail-ansi-bold" style="color:rgb(0,101,202);font-weight:bold">(self, line, cell)</span>
<span class="gmail-ansi-green-fg" style="color:rgb(0,162,80)">    309</span> <span class="gmail-ansi-bold" style="font-weight:bold;color:rgb(0,135,0)">if</span> args<span style="color:rgb(98,98,98)">.</span>raise_error <span class="gmail-ansi-bold" style="font-weight:bold;color:rgb(175,0,255)">and</span> p<span style="color:rgb(98,98,98)">.</span>returncode <span style="color:rgb(98,98,98)">!=</span> <span style="color:rgb(98,98,98)">0</span>:
<span class="gmail-ansi-green-fg" style="color:rgb(0,162,80)">    310</span>     <span style="color:rgb(95,135,135)"># If we get here and p.returncode is still None, we must have</span>
<span class="gmail-ansi-green-fg" style="color:rgb(0,162,80)">    311</span>     <span style="color:rgb(95,135,135)"># killed it but not yet seen its return code. We don't wait for it,</span>
<span class="gmail-ansi-green-fg" style="color:rgb(0,162,80)">    312</span>     <span style="color:rgb(95,135,135)"># in case it's stuck in uninterruptible sleep. -9 = SIGKILL</span>
<span class="gmail-ansi-green-fg" style="color:rgb(0,162,80)">    313</span>     rc <span style="color:rgb(98,98,98)">=</span> p<span style="color:rgb(98,98,98)">.</span>returncode <span class="gmail-ansi-bold" style="font-weight:bold;color:rgb(175,0,255)">or</span> <span style="color:rgb(98,98,98)">-</span><span style="color:rgb(98,98,98)">9</span>
<span class="gmail-ansi-green-intense-fg gmail-ansi-bold" style="color:rgb(0,116,39);font-weight:bold">--> 314</span>     <span class="gmail-ansi-bold" style="font-weight:bold;color:rgb(0,135,0)">raise</span> CalledProcessError(rc, cell)

<span class="gmail-ansi-red-intense-fg gmail-ansi-bold" style="color:rgb(178,43,49);font-weight:bold">CalledProcessError</span>: Command 'b'g.list rast\n'' returned non-zero exit status 127.</pre><pre style="font-size:13px;color:rgba(0,0,0,0.87);border:none;margin-top:0px;margin-bottom:0px;padding:0px;overflow:auto;word-break:break-all">--</pre><pre style="font-size:13px;color:rgba(0,0,0,0.87);border:none;margin-top:0px;margin-bottom:0px;padding:0px;overflow:auto;word-break:break-all"><br></pre><pre style="font-size:13px;color:rgba(0,0,0,0.87);border:none;margin-top:0px;margin-bottom:0px;padding:0px;overflow:auto;word-break:break-all">Also I am unable to install extensions r.stream.distance:</pre><pre style="font-size:13px;color:rgba(0,0,0,0.87);border:none;margin-top:0px;margin-bottom:0px;padding:0px;overflow:auto;word-break:break-all">!g.extension r.stream.distance</pre><pre style="font-size:13px;color:rgba(0,0,0,0.87);border:none;margin-top:0px;margin-bottom:0px;padding:0px;overflow:auto;word-break:break-all">as well as through the GUI</pre><pre style="font-size:13px;color:rgba(0,0,0,0.87);border:none;margin-top:0px;margin-bottom:0px;padding:0px;overflow:auto;word-break:break-all"><br></pre><pre style="font-size:13px;color:rgba(0,0,0,0.87);border:none;margin-top:0px;margin-bottom:0px;padding:0px;overflow:auto;word-break:break-all">both give me a "cannot find executable git" error</pre><pre style="font-size:13px;color:rgba(0,0,0,0.87);border:none;margin-top:0px;margin-bottom:0px;padding:0px;overflow:auto;word-break:break-all"><br></pre><pre style="font-size:13px;color:rgba(0,0,0,0.87);border:none;margin-top:0px;margin-bottom:0px;padding:0px;overflow:auto;word-break:break-all">Best,</pre><pre style="font-size:13px;color:rgba(0,0,0,0.87);border:none;margin-top:0px;margin-bottom:0px;padding:0px;overflow:auto;word-break:break-all">Vishal</pre><pre style="font-size:13px;color:rgba(0,0,0,0.87);border:none;margin-top:0px;margin-bottom:0px;padding:0px;overflow:auto;word-break:break-all"><br></pre></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Sep 29, 2023 at 11:53 AM Markus Neteler <<a href="mailto:neteler@osgeo.org">neteler@osgeo.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, Sep 28, 2023 at 10:09 PM Vishal Mehta <<a href="mailto:vishalm1975@gmail.com" target="_blank">vishalm1975@gmail.com</a>> wrote:<br>
><br>
> Thanks Markus and Vaclav,<br>
><br>
> This is what worked for me on Windows:<br>
> # Ask GRASS GIS where its Python packages are.<br>
> sys.path.append(<br>
>     subprocess.check_output(["C:\GRASS GIS 8.3/grass83.bat", "--config", "python_path"], text=True).strip()<br>
> )<br>
<br>
Perfect, added to the Wiki page, too.<br>
<br>
> Also, can I use bash within the jupyter notebook?<br>
<br>
Seems yes, after:<br>
<br>
pip install bash_kernel<br>
<br>
Markus<br>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Vishal K. Mehta, PhD<br>Sr. Scientist<br>Stockholm Environment Institute - US<br>501 D St <br>Davis CA 95616<br><a href="http://www.sei-us.org" target="_blank">https://www.sei.org/people/vishal-mehta/</a></div></div></div>