![]() ![]() However, PyGRASS depends on the dynamic libraries which are used through ctypes and loaded during import. If you really need to want setup the GRASS GIS runtime environment yourself, make sure you are using the following the documentation: The development version has also -exec option which is little bit more versatile: ) command help gives and option to set GRASS_BATCH_JOB variable to your script. In case you want to start the script automatically/programmatically without using GRASS GIS GUI, you can look at what the grass ( grass7, grass70. Finally, it allows you to use easily things like the automatically generated GUI. It will also make it easier to use it on different computers without changing the paths in the script. Writing a script which runs inside a GRASS session removes from you the need to setup the environment in the script and you can just focus on the functionality. The development version even contains an simple Python editor which has some special functions specific to GRASS GIS. You do it from menu File > Run script or from the command line. you start GRASS GIS and then you run the script). The default solution you should use is to write a Python script which will run inside GRASS session (i.e. 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. I have standalone install GRASS from official web site,Īnd i using python 2.7 32b and windows 10. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |