geometalab / Vector-Tiles-Reader-QGIS-Plugin

Vector Tiles Reader QGIS-Plugin - QGIS Python plugin which reads Mapbox Vector Tiles from a server, a local MBTiles file or a directory
http://plugins.qgis.org/plugins/vector_tiles_reader/
GNU General Public License v2.0
149 stars 30 forks source link

Can't load plugin (QGIS flatpak) #257

Closed ChameleonScales closed 5 years ago

ChameleonScales commented 5 years ago

Hi, I'm on Debian 9 with QGIS 3.8 stable (flatpak) and this message appears when I try to load the plugin :

Couldn't load plugin 'vector_tiles_reader' due to an error when calling its classFactory() method 

OSError: Could not find lib c or load any of its variants []. 
Traceback (most recent call last):
  File "/app/share/qgis/python/qgis/utils.py", line 334, in _startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "/home/geophom/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python/plugins/vector_tiles_reader/__init__.py", line 25, in classFactory
    from .plugin.vtr_plugin import VtrPlugin
  File "/app/share/qgis/python/qgis/utils.py", line 737, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/geophom/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python/plugins/vector_tiles_reader/plugin/vtr_plugin.py", line 51, in 
    from .vt_reader import VtReader
  File "/app/share/qgis/python/qgis/utils.py", line 737, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/geophom/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python/plugins/vector_tiles_reader/plugin/vt_reader.py", line 34, in 
    from .util.mp_helper import decode_tile_native, decode_tile_python, native_decoding_supported, unload_lib
  File "/app/share/qgis/python/qgis/utils.py", line 737, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/geophom/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python/plugins/vector_tiles_reader/plugin/util/mp_helper.py", line 7, in 
    import mapbox_vector_tile
  File "/app/share/qgis/python/qgis/utils.py", line 737, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/geophom/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python/plugins/vector_tiles_reader/ext-libs/mapbox_vector_tile/__init__.py", line 1, in 
    from . import encoder
  File "/app/share/qgis/python/qgis/utils.py", line 737, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/geophom/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python/plugins/vector_tiles_reader/ext-libs/mapbox_vector_tile/encoder.py", line 4, in 
    from shapely.geometry.base import BaseGeometry
  File "/app/share/qgis/python/qgis/utils.py", line 737, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/geophom/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python/plugins/vector_tiles_reader/ext-libs/shapely/geometry/__init__.py", line 4, in 
    from .base import CAP_STYLE, JOIN_STYLE
  File "/app/share/qgis/python/qgis/utils.py", line 737, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/geophom/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python/plugins/vector_tiles_reader/ext-libs/shapely/geometry/base.py", line 17, in 
    from shapely.coords import CoordinateSequence
  File "/app/share/qgis/python/qgis/utils.py", line 737, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/geophom/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python/plugins/vector_tiles_reader/ext-libs/shapely/coords.py", line 8, in 
    from shapely.geos import lgeos
  File "/app/share/qgis/python/qgis/utils.py", line 737, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/geophom/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python/plugins/vector_tiles_reader/ext-libs/shapely/geos.py", line 76, in 
    free = load_dll('c').free
  File "/home/geophom/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python/plugins/vector_tiles_reader/ext-libs/shapely/geos.py", line 56, in load_dll
    libname, fallbacks or []))
OSError: Could not find lib c or load any of its variants [].

Python version: 3.7.3 (default, Nov 10 2011, 15:00:00) [GCC 8.3.0] 
QGIS version: 3.8.3-Zanzibar Zanzibar, 685d8b15 

Python Path:
/app/share/qgis/python
/home/geophom/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python
/home/geophom/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python/plugins
/app/share/qgis/python/plugins
/usr/lib/python37.zip
/usr/lib/python3.7
/usr/lib/python3.7/lib-dynload
/usr/lib/python3.7/site-packages
/app/lib/python3.7/site-packages
/app/lib/python3.7/site-packages/numpy-1.14.3-py3.7-linux-x86_64.egg
/app/lib/python3.7/site-packages/MarkupSafe-1.0-py3.7-linux-x86_64.egg
/home/geophom/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python
/home/geophom/.var/app/org.qgis.qgis/data/QGIS/QGIS3/profiles/default/python/plugins/vector_tiles_reader/ext-libs

Since I'm not sure whether the problem comes from my system, the plugin ot the flatpak build, I also filed an issue on the flatpak's repo: https://github.com/flathub/org.qgis.qgis/issues/39

Thanks in advance

mnboos commented 5 years ago

That fails within Shapely, which is a dependency of this plugin. Could you try to install lib c?

ChameleonScales commented 5 years ago

I have a package called libc6 installed. Is that it? There can't be a space in a package name on Linux so lib c can't exist as is.

mnboos commented 5 years ago

I'm not a Linux expert, I only analyzed the stacktrace you provided. I would suggest you create an issue in the Shapely repo, they should be a greater help than me in this matter.

Can you try to install libc6-dev?

ChameleonScales commented 5 years ago

Can you try to install libc6-dev?

it was already installed too.

Why is shapely relevant here?

mnboos commented 5 years ago

Because the error happens in Shapelys code, not in mine.

ChameleonScales commented 5 years ago

Ok, thanks. I will first try it on a fresh Debian 10 install and if the error persists I will look deeper into it.

mnboos commented 5 years ago

Okay. In the case of further problems, feel free to reopen the issue.

ChameleonScales commented 5 years ago

I was right to try on a fresh Debian 10 install. It works fine now