0

Hey everyone:) It's possible that I have some kind of miss-conception in my head and just wanted to ask it here. I have a space-time-datacube in GRASS-Gis and now I'd like to create a process in PyWPS that lets me calculate some statistics for an index (e.g. the ndvi). I do have a script and I can create the process and see it on localhost. However, when I send a request to the server I always get:

PS&identifier=sen2_index&version=1.0.0 HTTP/1.1" 200 -
127.0.0.1 - - [22/Jun/2020 16:58:14] "GET /favicon.ico HTTP/1.1" 404 -
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/pywps/app/Process.py", line 236, in _run_process
    self._set_grass(wps_request)
  File "/usr/local/lib/python3.6/dist-packages/pywps/app/Process.py", line 362, in _set_grass
    from grass.script import core as grass
ModuleNotFoundError: No module named 'grass'
127.0.0.1 - - [22/Jun/2020 16:59:10] "GET /wps?request=Execute&service=WPS&identifier=sen2_index&version=1.0.0&datainputs=start=2019-07-01;end=2019-12-01 HTTP/1.1" 200 -

So it apparently doesn't find Grass. I'd like to give some more information about my installation etc., but I'm really sure how to access these informations. I do have miniconda installed and I always do a conda deactivate prior to start GRASS. At least to start the gui this is for some reason necessary (I think for matching the python-version).

If someone has any comment on what I could do or how to proceed, would be awesome:)

Update

I configured my pywps.cfg and modified the line gisbase=/usr/bin/grass78 to gisbase=/usr/lib/grass78

What I get now in my console is this here:

 "GET /wps?request=DescribeProcess&service=WPS&identifier=sen2_index&version=1.0.0 HTTP/1.1" 200 -
Traceback (most recent call last):
  File "/usr/lib/grass78/etc/python/grass/lib/ctypes_loader.py", line 76, in load
    return ctypes.cdll.LoadLibrary(path)
  File "/usr/lib/python3.6/ctypes/__init__.py", line 426, in LoadLibrary
    return self._dlltype(name)
  File "/usr/lib/python3.6/ctypes/__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libgrass_datetime.7.8.so: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/pywps/app/Process.py", line 236, in _run_process
    self._set_grass(wps_request)
  File "/usr/local/lib/python3.6/dist-packages/pywps/app/Process.py", line 414, in _set_grass
    from grass.pygrass.gis import make_mapset
  File "/usr/lib/grass78/etc/python/grass/pygrass/gis/__init__.py", line 13, in <module>
    import grass.lib.gis as libgis
  File "/usr/lib/grass78/etc/python/grass/lib/gis.py", line 23, in <module>
    _libs["grass_gis.7.8"] = load_library("grass_gis.7.8")
  File "/usr/lib/grass78/etc/python/grass/lib/ctypes_loader.py", line 62, in load_library
    return self.load(path)
  File "/usr/lib/grass78/etc/python/grass/lib/ctypes_loader.py", line 78, in load
    raise ImportError(e)
ImportError: libgrass_datetime.7.8.so: cannot open shared object file: No such file or directory
127.0.0.1 - - [23/Jun/2020 08:24:54] "GET /wps?request=Execute&service=WPS&identifier=sen2_index&version=1.0.0&datainputs=start=2019-07-01;end=2019-12-01 HTTP/1.1" 200 -


1

It looks like the system does not know the path of your current GRASS installation. Have you checked that you have the GRASSBIN set to your current GRASS version?

You can do that in the commandline (assuming your grass version is 7.8) like:

grass --config path
export GRASSBIN=grass78 

or directly from within your script like

import os
os.system('grass --config path')
os.system('export GRASSBIN=grass78')
| improve this answer | |
  • Thanks a lot! I tried it, but now I get a different error;) – Lenn Jun 23 at 6:26
  • 1
    Sorry to hear that it didn't help much. I have not used PyWPS much, so cannot offer a solution that I tried and worked. Just from the new error you updated, may be worth checking if you have permission issues? Maybe try 'sudo chmod -R 777 .shared_object_folder' – Hasnein Tareque Jun 23 at 7:02
  • 1
    Which error do you get now? – markusN Jun 23 at 11:39
  • The one under the "Update" heading. So something like OSError: libgrass_datetime.7.8.so: cannot open shared object file: No such file or directory. I don't know, but it can, that I have some serious dependency problems on my computer as I still didn't find a way to properly set up all the geospatial tools in a stable way on my computer;) – Lenn Jun 24 at 7:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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