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
-
Pygrass is integrated in GRASS GIS (Working with GRASS without starting it explicitly)gene– gene2016年11月29日 17:14:15 +00:00Commented Nov 29, 2016 at 17:14
-
i cant to import pygrass packages on the python script to start writing code.Mar– Mar2016年11月29日 17:25:14 +00:00Commented Nov 29, 2016 at 17:25
1 Answer 1
You can use Python/grass/PyGRASS from
1) the Python console of GRASS GIS
2) the shell of GRASS GIS
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 ...
-
i want to run outside in Linux but i dont know how to define paths to work with pygrassMar– Mar2016年11月29日 17:58:38 +00:00Commented Nov 29, 2016 at 17:58
-
In the reference, the script "Python: GRASS GIS 7 with existing location" explain the solution with Windows, Mac OS X and Linuxgene– gene2016年11月29日 18:20:33 +00:00Commented Nov 29, 2016 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 linuxMar– Mar2016年11月29日 18:29:00 +00:00Commented Nov 29, 2016 at 18:29 -
for example i define path
/usr/local/grass-7
in the python script but show me errorno module name grass.script
Mar– Mar2016年11月29日 18:44:01 +00:00Commented Nov 29, 2016 at 18:44 -
Without your script, we can do nothinggene– gene2016年11月29日 18:52:27 +00:00Commented Nov 29, 2016 at 18:52
Explore related questions
See similar questions with these tags.