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:
import grass.script as gscript gscript.run_command("v.db.dropcolumn", flags="help")
It raises the error:
grass.exceptions.CalledModuleError: Module run None v.db.dropcolumn --help ended with error. Process ended with non-zero return code 9009
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:
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. Does anybody know how to solve this?