First note, that this is good to do only when you actually need it. It seems that you are trying to use GRASS GIS in Python from outside of GRASS session, i.e. ctypes_loader.py.load_library) shows that the problem is in loading the C dynamic libraries using C types which are not found. Use grass72 for upcoming 7.2 release and grass70 for the current release 7.0 (7.0.4).Īll the other errors say ImportError: grass_gis.7.0.4 not found which in connection with the previous lines (e.g. Grass73 currently denotes the development version. It really looks like you are using some outdated (wrong?) documentation. The from import coor2pixel import should be from import coor2pixel. Is what you are using from some documentation? The import from import raster as r looks like you want to say from import raster as r. The name for the module is as you are using it in the other examples. The import from pygrass.modules import Module causes No module named pygrass.modules because there is no such module. You need to use import grass.script because that's the name of the module. from import coor2pixelĪny idea why to i can import some imports from the pygrass and why i cant import some other imports from pygrass ? from import raster as rĮrror message: ImportError: cannot import name rasterĩ. from import RasterRowįrom import RasterRowįile "C:\Program Files (x86)\GRASS GIS 7.0.4\etc\python\grass\pygrass\raster\_init_.py", line 14, in Ħ. from import VectorTopoĮrror message : Traceback (most recent call last):įrom import VectorTopoįile "C:\Program Files (x86)\GRASS GIS 7.0.4\etc\python\grass\pygrass\vector\_init_.py", line 3, in Ĥ. Raise ImportError,"%s not found." % libnameģ. _libs = load_library("grass_gis.7.0.4")įile "C:\Program Files (x86)\GRASS GIS 7.0.4\etc\python\grass\lib\ctypes_loader.py", line 57, in load_library Success imports import grass.script as grassįrom import general as gįrom import Module as run_commandįrom import imagery as iĮrror message: No module named pygrass.modulesĮrror message: Traceback (most recent call last):įile "C:\Program Files (x86)\GRASS GIS 7.0.4\etc\python\grass\pygrass\gis\_init_.py", line 13, in įile "C:\Program Files (x86)\GRASS GIS 7.0.4\etc\python\grass\lib\gis.py", line 23, in Gisbase = os.environ = "C:\Program Files (x86)\GRASS GIS 7.0.4" Some imports work i can import in the python ide and some imports not works and i cant to using.įirst i read this post grass python and i trying to take pygrass api I trying to works with python api from GRASS GIS 7.0.4.
#PYTHON COMMANDS FOR GRASS GIS INSTALL#
I have standalone install GRASS from official web site,Īnd i using python 2.7 32b and windows 10.