gis-ops / valhalla-qgis-plugin

QGIS plugin to use Valhalla for routing, isochrones and matrices.
GNU General Public License v3.0
12 stars 3 forks source link

qgis_process cannot start Valhalla plugin #12

Closed florisvdh closed 9 months ago

florisvdh commented 9 months ago

Some changes appear necessary to make the Valhalla plugin work with the command-line utility qgis_process (see its docs), which is installed with QGIS; see output below. An error NoneType: None is thrown, and although at first the plugin seems enabled for qgis_process, it is not accessible by qgis_process and shown as unloaded by subsequent calls to qgis_process plugins. Note that qgis_process plugins enable valhalla is successful at making the plugin active in the QGIS GUI though.

BTW running qgis_process plugins disable valhalla successfully makes it inactive after which the error is gone (not shown), but of course then Valhalla is inaccessible (including in QGIS GUI).

FYI ± similar things have been solved in the past with Lat Lon Tools, QNeat3 and Viewshed Analysis (linking here the related issues).

$ qgis_process plugins
Available plugins
(* indicates loaded plugins which implement Processing providers)

* QNEAT3
  valhalla
  processing_saga_nextgen
* pcraster_tools
* ViewshedAnalysis
* cartography_tools
* wbt_for_qgis
* latlontools
* grassprovider
* otbprovider
* processing
$ 
$ qgis_process plugins enable valhalla
Enabling plugin: "valhalla"
NoneType: None

Enabled valhalla (Valhalla)

Available plugins
(* indicates enabled plugins which implement Processing providers)

* QNEAT3
* valhalla
  processing_saga_nextgen
* pcraster_tools
* ViewshedAnalysis
* cartography_tools
* wbt_for_qgis
* latlontools
* grassprovider
* otbprovider
* processing
$ 
$ qgis_process plugins
NoneType: None

error starting plugin: valhalla

Available plugins
(* indicates loaded plugins which implement Processing providers)

* QNEAT3
  valhalla
  processing_saga_nextgen
* pcraster_tools
* ViewshedAnalysis
* cartography_tools
* wbt_for_qgis
* latlontools
* grassprovider
* otbprovider
* processing
$ 
$ qgis_process --version
QGIS 3.32.3-Lima 'Lima' (67d46100b5)
QGIS code revision 67d46100b5
Qt version 5.15.3
Python version 3.10.12
GDAL/OGR version 3.6.4
PROJ version 9.1.1
EPSG Registry database version v10.076 (2022-08-31)
GEOS version 3.11.1-CAPI-1.17.1
SQLite version 3.37.2
OS Linux Mint 21.2

This was first observed in macOS, in an issue reported by a user of the R package {qgisprocess}, which calls qgis_process as backend to run QGIS processing algorithms in R.

nilsnolde commented 9 months ago

Thanks for the report. Seems easy enough to fix, let me do that later or tmrw

nilsnolde commented 9 months ago

Thanks for the hints with the other plugins, that made it a 5 mins change. However, seems like arch linux is not compiling QGIS properly to support qgis_process, see output below. I can't test it like that.. Would you be up for testing that https://github.com/gis-ops/valhalla-qgis-plugin/pull/13 works @florisvdh ? Let me know if you need pointers how to approach that.

 qgis_process plugins enable valhalla
ERROR 1: libarrow.so.1300: cannot open shared object file: No such file or directory
ERROR 1: libarrow.so.1300: cannot open shared object file: No such file or directory
ERROR 1: libpodofo.so.0.9.8: cannot open shared object file: No such file or directory
ERROR 1: libpodofo.so.0.9.8: cannot open shared object file: No such file or directory
ERROR 1: libarrow_dataset.so.1300: cannot open shared object file: No such file or directory
ERROR 1: libarrow_dataset.so.1300: cannot open shared object file: No such file or directory
ERROR 1: libcfitsio.so.10: cannot open shared object file: No such file or directory
ERROR 1: libcfitsio.so.10: cannot open shared object file: No such file or directory
ERROR 1: libmariadb.so.3: cannot open shared object file: No such file or directory
ERROR 1: libmariadb.so.3: cannot open shared object file: No such file or directory
"<font color=\"red\">Couldn't load SIP module.<br>Python support will be disabled.</font><br><pre><br>Traceback (most recent call last):<br>&nbsp; File \"<string>\", line 1, in <module><br>ModuleNotFoundError: No module named 'qgis'<br><br></pre>Python version:<br>3.11.5 (main, Sep&nbsp; 2 2023, 14:16:33) [GCC 13.2.1 20230801]<br><br>QGIS version:<br>3.32.2-Lima 'Lima', exported<br><br>Python path:<br>['/usr/share/qgis/python', '/home/nilsnolde/.local/share/QGIS/QGIS3/profiles/default/python', '/home/nilsnolde/.local/share/QGIS/QGIS3/profiles/default/python/plugins', '/usr/share/qgis/python/plugins', '/usr/lib/python311.zip', '/usr/lib/python3.11', '/usr/lib/python3.11/lib-dynload', '/home/nilsnolde/Programs/global_venv/lib/python3.11/site-packages']"
Enabling plugin: "valhalla"
[1]    7507 segmentation fault (core dumped)  qgis_process plugins enable valhalla
nilsnolde commented 9 months ago

Ohhh wait, I have a global venv. One sec..

nilsnolde commented 9 months ago

Yeah thanks to Python's beyond-recognition-broken packaging system I had a global venv. Finally found the line to disable that and seems to work:

qgis_process plugins disable valhalla  
ERROR 1: libarrow.so.1300: cannot open shared object file: No such file or directory
ERROR 1: libarrow.so.1300: cannot open shared object file: No such file or directory
ERROR 1: libpodofo.so.0.9.8: cannot open shared object file: No such file or directory
ERROR 1: libpodofo.so.0.9.8: cannot open shared object file: No such file or directory
ERROR 1: libarrow_dataset.so.1300: cannot open shared object file: No such file or directory
ERROR 1: libarrow_dataset.so.1300: cannot open shared object file: No such file or directory
ERROR 1: libcfitsio.so.10: cannot open shared object file: No such file or directory
ERROR 1: libcfitsio.so.10: cannot open shared object file: No such file or directory
ERROR 1: libmariadb.so.3: cannot open shared object file: No such file or directory
ERROR 1: libmariadb.so.3: cannot open shared object file: No such file or directory
Disabling plugin: "valhalla"
Disabled valhalla

Available plugins
(* indicates enabled plugins which implement Processing providers)

* network_analyst
* latlontools
* QuickOSM
  valhalla
* ORStools
* processing
* grassprovider
  otbprovider

 nilsnolde@framework-xfce  ~  qgis_process plugins enable valhalla
ERROR 1: libarrow.so.1300: cannot open shared object file: No such file or directory
ERROR 1: libarrow.so.1300: cannot open shared object file: No such file or directory
ERROR 1: libpodofo.so.0.9.8: cannot open shared object file: No such file or directory
ERROR 1: libpodofo.so.0.9.8: cannot open shared object file: No such file or directory
ERROR 1: libarrow_dataset.so.1300: cannot open shared object file: No such file or directory
ERROR 1: libarrow_dataset.so.1300: cannot open shared object file: No such file or directory
ERROR 1: libcfitsio.so.10: cannot open shared object file: No such file or directory
ERROR 1: libcfitsio.so.10: cannot open shared object file: No such file or directory
ERROR 1: libmariadb.so.3: cannot open shared object file: No such file or directory
ERROR 1: libmariadb.so.3: cannot open shared object file: No such file or directory
Enabling plugin: "valhalla"
Enabled valhalla (Valhalla)

Available plugins
(* indicates enabled plugins which implement Processing providers)

* network_analyst
* latlontools
* QuickOSM
* valhalla
* ORStools
* processing
* grassprovider
  otbprovider
nilsnolde commented 9 months ago

(though there's still smth broken with arch's QGIS installation, sounds a lot like new GDAL deps missing)

florisvdh commented 9 months ago

Solved :rocket:, see https://github.com/gis-ops/valhalla-qgis-plugin/pull/13#issuecomment-1734097501. Thanks a lot :pray:.