[GRASS-user] Using Python in GRASS GIS for analysis

Omkar Kadlag kadlagomkar119 at gmail.com
Tue Feb 2 22:49:40 PST 2021


Hello Sir/Ma'am,

Warm Greetings.

I am Omkar Kadlag from Mumbai,India.I am pursuing Electronics and
Telecommunication Engineering majors from K.J.Somaiya Institute of
Engineering and Information Technology,Mumbai. I am working on a project
"Watershed Analysis using python".

While using GRASS GIS python console for analysis, I'm unable to get
desired results. While giving the input ( as a DEM tile ) in the PowerShell
prompt of GRASS GIS Software, it gives an error, as 'wxpython file' is not
available.

Error -

Starting GRASS GIS...
Traceback (most recent call last):
  File "C:\Program Files\GRASS GIS 7.8\gui\wxpython\gis_set.py", line 43,
in <module>
    from core.gcmd import GMessage, GError, DecodeString, RunCommand
  File "C:\Program Files\GRASS GIS 7.8\gui\wxpython\core\gcmd.py", line 43,
in <module>
    from win32file import ReadFile, WriteFile
ImportError: DLL load failed: The specified procedure could not be found.
ERROR: Error in GUI startup. See messages above (if any) and if necessary,
please report this error to the GRASS developers.
On systems with package manager, make sure you have the right GUI package,
probably named grass-gui, installed.
To run GRASS GIS in text mode use the --text flag.
Use '--help' for further options
     grass78 --help
See also: https://grass.osgeo.org/grass78/manuals/helptext.html
Exiting...
Press any key to continue . . .

Then I made a new environment in the anaconda prompt, where I installed
'wxpython' and was successfully able to run GRASS GIS software, but now the
issue is I can't use the command prompt for my analysis. Then I tried to
give inputs in the anaconda command prompt but was still unable to get
correct outputs.

Error:
(base) PS C:\Users\Omkar> conda activate geopandas_env
(geopandas_env) PS C:\Users\Omkar> cd 'C:\Program Files\'
(geopandas_env) PS C:\Program Files> grass78 --gui
Starting GRASS GIS...
WARNING: Concurrent mapset locking is not supported on Windows
Cleaning up temporary files...

          __________  ___   __________    _______________
         / ____/ __ \/   | / ___/ ___/   / ____/  _/ ___/
        / / __/ /_/ / /| | \__ \\_  \   / / __ / / \__ \
       / /_/ / _, _/ ___ |___/ /__/ /  / /_/ // / ___/ /
       \____/_/ |_/_/  |_/____/____/   \____/___//____/

Welcome to GRASS GIS 7.8.5
GRASS GIS homepage:                      https://grass.osgeo.org
This version running through:            Command Prompt
(C:\WINDOWS\system32\cmd.exe)
Help is available with the command:      g.manual -i
See the licence terms with:              g.version -c
See citation options with:               g.version -x
If required, restart the GUI with:       g.gui wxpython
When ready to quit enter:                exit

Launching <wxpython> GUI in the background, please wait...
Microsoft Windows [Version 10.0.19042.746]
(c) 2020 Microsoft Corporation. All rights reserved.

C:\Program Files>r.in.gdal -e
input="D:\NRSC\Month_Jan\ASTGTMV003_N19E073-dem" output=DEM
ERROR: Unable to open datasource <D:\NRSC\Month_Jan\ASTGTMV003_N19E073-dem>
C:\Program Files>

I want solutions where I can run GRASS GIS directly from the command line
and implement my solutions on that.

Yours Sincerely,
Omkar.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20210203/2afd43c2/attachment.html>


More information about the grass-user mailing list