EarthObservation / rvt-qgis

Apache License 2.0
14 stars 5 forks source link

Plugin is not working when QGIS is installed from OSGeo4W installer #15

Closed lieti closed 2 years ago

lieti commented 2 years ago

Hi, I have problems to install plugin in QGIS (3.24.2/3.25.x, WIN10, multiple PC, blank profile). It's seems that is happening when QGIS is instaled form OSGeo4W installer, that mean different path to instalation of QGIS. Here is python error log

2022-05-11T08:49:31 CRITICAL Traceback (most recent call last): File "C:\OSGEO4~2/apps/qgis/./python\qgis\utils.py", line 423, in _startPlugin plugins[packageName] = package.classFactory(iface) File "C:\Users/Tibor/AppData/Roaming/QGIS/QGIS3\profiles\TRAIL/python/plugins\rvt-qgis\__init__.py", line 35, in classFactory from .qrvt import QRVT File "C:\OSGEO4~2/apps/qgis/./python\qgis\utils.py", line 888, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "C:\Users/Tibor/AppData/Roaming/QGIS/QGIS3\profiles\TRAIL/python/plugins\rvt-qgis\qrvt.py", line 53, in import rvt.tile File "C:\OSGEO4~2/apps/qgis/./python\qgis\utils.py", line 888, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "C:\Users/Tibor/AppData/Roaming/QGIS/QGIS3\profiles\TRAIL/python/plugins\rvt-qgis\rvt\tile.py", line 23, in import rvt.default File "C:\OSGEO4~2/apps/qgis/./python\qgis\utils.py", line 888, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "C:\Users/Tibor/AppData/Roaming/QGIS/QGIS3\profiles\TRAIL/python/plugins\rvt-qgis\rvt\default.py", line 27, in import rvt.vis File "C:\OSGEO4~2/apps/qgis/./python\qgis\utils.py", line 888, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "C:\Users/Tibor/AppData/Roaming/QGIS/QGIS3\profiles\TRAIL/python/plugins\rvt-qgis\rvt\vis.py", line 22, in import scipy.interpolate File "C:\OSGEO4~2/apps/qgis/./python\qgis\utils.py", line 888, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "C:\OSGEO4~2\apps\Python39\lib\site-packages\scipy\__init__.py", line 136, in from . import _distributor_init File "C:\OSGEO4~2/apps/qgis/./python\qgis\utils.py", line 888, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "C:\OSGEO4~2\apps\Python39\lib\site-packages\scipy\_distributor_init.py", line 59, in WinDLL(os.path.abspath(filename)) File "C:\OSGEO4~2\apps\Python39\lib\ctypes\__init__.py", line 374, in __init__ self._handle = _dlopen(self._name, mode) FileNotFoundError: Could not find module 'C:\OSGEO4~2\apps\Python39\lib\site-packages\scipy\.libs\libbanded5x.MNILF2E5WWV6CLD73VU2TNV3JP7W3RT3.gfortran-win_amd64.dll' (or one of its dependencies). Try using the full path with constructor syntax.

Here is general log:

2022-05-11T08:49:32 INFO Application state: QGIS_PREFIX_PATH env var: C:/OSGEO4~2/apps/qgis Prefix: C:/OSGEO4~2/apps/qgis Plugin Path: C:/OSGEO4~2/apps/qgis/plugins Package Data Path: C:/OSGEO4~2/apps/qgis/. Active Theme Name: default Active Theme Path: C:/OSGEO4~2/apps/qgis/./resources/themes\default\icons/ Default Theme Path: :/images/themes/default/ SVG Search Paths: C:/OSGEO4~2/apps/qgis/./svg/ C:/Users/Tibor/AppData/Roaming/QGIS/QGIS3\profiles\TRAIL/svg/ User DB Path: C:/OSGEO4~2/apps/qgis/./resources/qgis.db Auth DB Path: C:/Users/Tibor/AppData/Roaming/QGIS/QGIS3\profiles\TRAIL/qgis-auth.db

With using of instalation of QGIS by standalone installer everyrhing works ok. But in case of QGIS it is nice to consider that sometimes in OSGeo4W installer used (e.g. to get nightly versions of QGIS).

Anyway, thanks for plugin :)

zm8597 commented 2 years ago

Hey :),

thank you for this bug report and sorry for the late reply. I assume that scipy is not a part of OSGeo4W installer. You can fix this problem with opening the OSGeo4W Shell and then running python -m pip install scipy. Let me know if this won't fix your problem 😄.

zm8597 commented 2 years ago

Another way of doing it (works only on Linux) would be installing scipy from the code (I need to include that in the plugin). If you go to QGIS under Plugins open Python console and in the console run this:

import sys
import subprocess
subprocess.check_call([sys.executable, "-m", "pip", "install", "scipy"])
lieti commented 2 years ago

Hi thanks for reply, manual solution with provided command works fine, thanks for it. In the newest version of plugin 0.9.2 attempt to install scipy was not successful. At the start of QGIS I have red warnings image On multiple warnings I see individual parts of command "-m", "pip", "install", "scipy"

zm8597 commented 2 years ago

Hey thank you for helping me with testing 😃. I realized that automatic solution works only for linux, I haven't managed to find an automatic solution for windows yet.