geoniesun / checkRtrack

Other
2 stars 0 forks source link

[MB2 feedback] `checkMin()` and `qgis_configure()` fail #4

Open 16EAGLE opened 4 months ago

16EAGLE commented 4 months ago

Nice package!

Installation works fine, but if I try to run checkMin(), I get the following error:

> mini <- checkMin(dsm, tracks, export = FALSE, dist_cross = 1, profile_length = 1, dist_cross_points = 0.05, st_dev = 0.06)
#> Error in `assert_qgis()`:
#> ! The 'qgis_process' command-line utility was either not found or
#> did not fulfil the needs to build the package cache.
#> Please run `qgis_configure()` to fix this and rebuild the cache.
#> See its documentation if you need to preset the path of qgis_process.
#> Run `rlang::last_trace()` to see where the error occurred.

Running qgisprocess::qgis_configure() afterwards does not help:

> qgisprocess::qgis_configure()
#> getOption('qgisprocess.path') was not found.
#> Sys.getenv('R_QGISPROCESS_PATH') was not found.
#> Trying 'qgis_process' on PATH...
#> Success!
#> Now using 'qgis_process' in the system PATH.
#> >>> If you need another installed QGIS instance, run `qgis_configure()`;
#>     see `?qgis_configure` if you need to preset the path of 'qgis_process'.
#> 
#> QGIS version is now set to: 3.36.0-Maidenhead
#> Using JSON for output serialization.
#> Using JSON for input serialization.
#> 
#> ATTENTION: the QGIS plugins could not be queried. You will loose some functionality.
#> You may want to (re)run `qgis_configure()`; see its documentation.
#> Error message was:
#> 
#> Error in "processx::run(path, args, ...)": ! System command 'qgis_process' failed
#> 
#> "<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.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]<br><br>QGIS version:<br>3.36.0-Maidenhead 'Maidenhead', 09951dc0acf<br><br>Python path:<br>['/usr/share/qgis/python', '/home/myuser/.local/share/QGIS/QGIS3/profiles/default/python', '/home/myuser/.local/share/QGIS/QGIS3/profiles/default/python/plugins', '/usr/share/qgis/python/plugins', '/home/myuser/.conda/envs/tf/lib/python310.zip', '/home/myuser/.conda/envs/tf/lib/python3.10', '/home/myuser/.conda/envs/tf/lib/python3.10/lib-dynload', '/home/myuser/.conda/envs/tf/lib/python3.10/site-packages']"
#> 
#> ATTENTION: the QGIS algorithms could not be queried. You will loose some functionality.
#> You may want to (re)run `qgis_configure()`; see its documentation.
#> Error message was:
#> 
#> Error in "processx::run(path, args, ...)": ! System command 'qgis_process' failed
#> 
#> "<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.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]<br><br>QGIS version:<br>3.36.0-Maidenhead 'Maidenhead', 09951dc0acf<br><br>Python path:<br>['/usr/share/qgis/python', '/home/myuser/.local/share/QGIS/QGIS3/profiles/default/python', '/home/myuser/.local/share/QGIS/QGIS3/profiles/default/python/plugins', '/usr/share/qgis/python/plugins', '/home/myuser/.conda/envs/tf/lib/python310.zip', '/home/myuser/.conda/envs/tf/lib/python3.10', '/home/myuser/.conda/envs/tf/lib/python3.10/lib-dynload', '/home/myuser/.conda/envs/tf/lib/python3.10/site-packages']"
#> 
#> >>> PROBLEM encountered: couldn't build and save package cache! <<<
#> The 'qgis_process' command-line utility was either not found or
#> did not fulfil the needs to build the package cache.
#> Please run `qgis_configure()` to fix this and rebuild the cache.
#> See its documentation if you need to preset the path of qgis_process.
#> If the problem persists, make sure that you correctly installed QGIS
#> for your operating system using the instructions at
#> <https://download.qgis.org>.
#> 

Do you have any idea how I could solve this to get your functions to run?

geoniesun commented 4 months ago

Hey Jakob, thanks for the feedback and sorry for the late reply. I was trying to figure out why it won't work. I first thought it's the QGIS version, but I just checked Maidenhead (before I used Prizren) and it works there too on my Windows. Maybe run qgisprocess:::qgis_reconfigure(), it could show the cause of the problem.

Then also please check with qgis_path() if this is set correctly (something like: "C:/Program Files/QGIS 3.36.2/bin/qgis_process-qgis.bat") What happens if you type qgis_plugins()? You could enable plugins by qgis_enable_plugins().

Note to myself: better creating a package independent of qgisprocess. When I started, I was not aware of such issues. ;(

Hope it gets solved with that, let me know.

Leonie