<div dir="ltr">Dear Stefan, <div><br></div><div>The GRASS version is 8.4.1. and the simple commands I used are the ones in my previous email. </div><div>You helped me solve the problem; I had not added the addons and "C:\Program Files\GRASS GIS 7.8\scripts" into the PATH variable. Now I did and it solved the mistake. </div><div>Thank you very much! </div><div><br></div><div>Cheers, </div><div>Camille </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le ven. 15 janv. 2021 à 15:08, Stefan Blumentrath <<a href="mailto:Stefan.Blumentrath@nina.no">Stefan.Blumentrath@nina.no</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="NO-BOK">
<div class="gmail-m_5241054757250302698WordSection1">
<p class="MsoNormal"><span>Dear Camille,<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I don`t get that error in GRASS 7.8.3 with your example.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Can you post the exact command (if it was different from your example), and GRASS version as well as OS?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Addons need to be on your PATH / ADDON_PATH.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Cheers<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Stefan<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> grass-user <<a href="mailto:grass-user-bounces@lists.osgeo.org" target="_blank">grass-user-bounces@lists.osgeo.org</a>>
<b>On Behalf Of </b>Cam Morlus<br>
<b>Sent:</b> fredag 15. januar 2021 11:37<br>
<b>To:</b> <a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a><br>
<b>Subject:</b> [GRASS-user] Can't use simple GRASS modules in python when not using ".py" in module call<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Dear All, <u></u><u></u></p>
<div>
<p class="MsoNormal"><br>
I am using grass 7.8.4. I'm trying to run some simple commands using the Grass Python Scripting Library in Python. For modules for which the source code is written in C or any other language than Python, it works without problem but for the modules written
 in Python it does not. Here is an example of a simple command I tried to run:<br>
<span style="color:rgb(102,102,102);background:rgb(238,238,238)"><br>
import grass.script as gscript<br>
gscript.run_command("v.db.dropcolumn", flags="help")</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><br>
It raises the error:<br>
<span style="color:rgb(102,102,102);background:rgb(238,238,238)"><br>
grass.exceptions.CalledModuleError: Module run None v.db.dropcolumn --help ended with error.<br>
Process ended with non-zero return code 9009</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I already checked and I know that return code 9009 means it does not find the python script. I solved the error by just adding ".py" in the command:<br>
<br>
<span style="color:rgb(102,102,102);background:rgb(238,238,238)">gscript.run_command("<a href="https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fv.db.dropcolumn.py%2F&data=04%7C01%7C%7C6777bf389f194dc3954a08d8b941928a%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637463038877120044%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ra6Nu%2FwP%2BDmHIPxzKtlzwo%2FzLJuve01OwcqqXQweW7k%3D&reserved=0" target="_blank">v.db.dropcolumn.py</a>",
 flags="help")</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I would like the command to work without the ".py" because I'm writing a python script that makes use of some addons. For the addons to work in my python script I sometimes need to modify them because there are running commands like "v.db.dropcolumn"
 without the ".py", so I have to add it. But then, the addons do not work anymore when I use them directly in the grass GUI. I tried to use pygrass and it also raises an error if I'm using Module("v.db.dropcolumn") instead of Module("<a href="https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fv.db.dropcolumn.py%2F&data=04%7C01%7C%7C6777bf389f194dc3954a08d8b941928a%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637463038877120044%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ra6Nu%2FwP%2BDmHIPxzKtlzwo%2FzLJuve01OwcqqXQweW7k%3D&reserved=0" target="_blank">v.db.dropcolumn.py</a>"). <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Does anybody know how to solve this?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Thank you in advance for the answer, <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Best, <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Camille Morlighem <u></u><u></u></p>
</div>
</div>
</div>
</div>

</blockquote></div>