heremaps / xyz-qgis-plugin

Plugin for QGIS to connect to the HERE Platform IML
https://plugins.qgis.org/plugins/XYZHubConnector/
MIT License
27 stars 9 forks source link

installation shows error #15

Closed riccardoklinger closed 4 years ago

riccardoklinger commented 5 years ago

I used the plugin installer to install the plugin in QGIS 3.4.4... Unfortunately it "fails" with this message:

  File "/home/ricckli/.local/share/QGIS/QGIS3/profiles/default/python/plugins/XYZHubConnector/modules/layer/__init__.py", line 11, in 
    from .layer import XYZLayer
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 672, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/ricckli/.local/share/QGIS/QGIS3/profiles/default/python/plugins/XYZHubConnector/modules/layer/layer.py", line 141
    sql_constraint = f'"{parser.QGS_XYZ_ID}" TEXT UNIQUE ON CONFLICT REPLACE' # replace older duplicate

My setup:

Python version: 3.5.2 (default, Nov 12 2018, 13:43:14) [GCC 5.4.0 20160609] 
QGIS version: 3.4.4-Madeira Madeira, f6ddc62 

On Ubuntu/Elementary OS

minff commented 5 years ago

This error is caused by incompatibility with old version of python (3.5.2). The fix is added since version 1.6.2. However, I would recommend to use a qgis build with a more recent python version (3.6+) if possible for more stabitlity and functionality.

riccardoklinger commented 5 years ago

Yet you need to agree that the new LTR release is 3.4.8 which should every plugin be tested on. I was trying to change my Pythonpath to use the locally available 3.7.2 python version. yet no success. I would propose to check maybe the version: import sys if sys.version_info.minor < 3.6: blablub thanks for the change. works now on my system as well. would close this, when 1.6.2 is in the official repo.

minff commented 5 years ago

Regarding the python version, I think that depends on when the QGIS is built and the platform. For instance, my qgis builds (Windows) all comes with recent python version:

QGIS version 3.4.4-Madeira
Python: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)]
QGIS version 3.0.3-Girona
3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)]

To have QGIS with recent python version, I guess we need to rebuild or redownload the preferred QGIS release.

Having a version check makes lots of sense. Thanks for the suggestion.