1

I have Ubuntu 16.04 64 bit and python 2.7.12 on my system. I have installed GRASS GIS 7 from the Ubuntu software support (I thing not is the better choose for install).

Now I want to take GRASS Python API to run standalone Python scripts.

How can I install Python GRASS API(pygrass) to work in the Ubuntu, any idea?

On the Windows must be define paths and work, on LINUX I can't find any tutorial for that.


the script test

 import os
 import sys
 import subprocess

 grass70='/usr/lib/grass70'

 import grass.script as gscript

error :

no module name grass.script
2
1

You can use Python/grass/PyGRASS from

1) the Python console of GRASS GIS

enter image description here

2) the shell of GRASS GIS

enter image description here

3) from outside, examples for Linux in Working with GRASS without starting it explicitly and Is it possible to use GRASS GIS in Python stand alone scripts?,and ...

5
  • i want to run outside in Linux but i dont know how to define paths to work with pygrass
    – Mar
    Nov 29 '16 at 17:58
  • In the reference, the script "Python: GRASS GIS 7 with existing location" explain the solution with Windows, Mac OS X and Linux
    – gene
    Nov 29 '16 at 18:20
  • for the Linux say grass70 --config path /usr/local/grass-7.0.2svn.that all ?how to define this path on the Linux ?i am newbie in linux
    – Mar
    Nov 29 '16 at 18:29
  • for example i define path /usr/local/grass-7 in the python script but show me error no module name grass.script
    – Mar
    Nov 29 '16 at 18:44
  • Without your script, we can do nothing
    – gene
    Nov 29 '16 at 18:52

Not the answer you're looking for? Browse other questions tagged or ask your own question.