GlobeBuilder icon indicating copy to clipboard operation
GlobeBuilder copied to clipboard

Install fails on Ubuntu with 3.10

Open ianturton opened this issue 5 years ago • 15 comments

Apparently qRegisterResourceData(int, bytes, bytes, bytese): argument 2 has unexpected type 'str' at line 440 of resources.py.

Environment

QGIS version 3.10.1-A Coruña QGIS code revision ef24c526da Compiled against Qt 5.9.5 Running against Qt 5.9.5 Compiled against GDAL/OGR 2.2.3 Running against GDAL/OGR 2.2.3 Compiled against GEOS 3.6.2-CAPI-1.10.2 Running against GEOS 3.7.1-CAPI-1.11.1 27a5e771 Compiled against SQLite 3.22.0 Running against SQLite 3.22.0 PostgreSQL Client Version 10.10 (Ubuntu 10.10-0ubuntu0.18.04.1) SpatiaLite Version 4.3.0a QWT Version 6.1.3 QScintilla2 Version 2.10.2 PROJ.4 Version 493 OS Version Ubuntu 18.04.3 LTS Active python plugins EasyCustomLabeling; vrtbuilderplugin; autoSaver; QGIS3-getWKT; qgis_hats; MemoryLayerSaver; isochrones; firstaid; OSMDownloader; qchainage; plugin_reloader; profiletool; polystrip; save_attributes; cartogram3; Hqgis; pluginbuilder3; quick_map_services; pointsamplingtool; gml_application_schema_toolbox; DataPlotly; QuickWKT; timemanager; processing; MetaSearch; db_manager

ianturton avatar Jan 15 '20 08:01 ianturton

Thank you for reporting the issue. This seems quite strange, since I have developed the plugin on Ubuntu 18.04 and have same Qt and QGIS versions. When using pyrcc5 all qt_resource_structs should be bytes instead of strings. In release versions they seem to be so. Did you try to compile resources.py yourself? If that is the case, this line should produce the correct version: pyrcc5 resources.qrc -o resources.py.

Joonalai avatar Jan 15 '20 09:01 Joonalai

@Joonalai The same message is recieved on win10 with 3.10. Trued the latest release zip. I did not try to compile the resources but did get the exact same message Ian did.

bogind avatar Jan 15 '20 13:01 bogind

That's odd... Can you check if the version from QGIS Plugins Repository works if installed trough QGIS?

Joonalai avatar Jan 15 '20 13:01 Joonalai

@Joonalai Tried that one first and got the same message. That's why i tried the latest release from here. Did not try any earlier releases.

bogind avatar Jan 15 '20 13:01 bogind

Alright, I will further investigate this.

Joonalai avatar Jan 15 '20 14:01 Joonalai

I get the same result

Ian

On Wed, 15 Jan 2020 at 13:56, Joonalai [email protected] wrote:

That's odd... Can you check if the version from QGIS Plugins Repository https://plugins.qgis.org/plugins/GlobeBuilder/ works if installed trough QGIS?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/GispoCoding/GlobeBuilder/issues/1?email_source=notifications&email_token=AAA55IKGBCQNGJM2YHH3PA3Q54IYLA5CNFSM4KG7PX42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJAMKBY#issuecomment-574670087, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA55INJ7KCWRVOLEKPHJU3Q54IYLANCNFSM4KG7PX4Q .

-- Ian Turton

ianturton avatar Jan 15 '20 14:01 ianturton

Just got the same from the qgis plugin repo. Windows 10, qgis 3.10 plugin version lists as 0.3.0

emilyselwood avatar Jan 23 '20 09:01 emilyselwood

I have tried installing the plugin with numerous different QGIS 3.x versions both on Ubuntu and on Windows. I even installed all the plugins mentioned in the Environment of the issue but I still cannot reproduce the bug and it works normally.

Have you had previously (or still) QGIS 2.x installed on the same machine? It seems that this error is mainly occurring when migrating plugins from QGIS 2 to QGIS 3 environment.

Joonalai avatar Jan 23 '20 13:01 Joonalai

Nope, I've had 3.4 and upgraded from there to 3.8 then 3.10. This was a new laptop in September last year. 99.9% sure I never installed any of the 2 line on here.

emilyselwood avatar Jan 23 '20 14:01 emilyselwood

@Joonalai I do have QGIS 2.18 installed on my windows machine, Tried and succeeded on my ubuntu 16.04 with QGIS 3.4, Have not tried updating to newer 3.x for testing.

bogind avatar Jan 23 '20 14:01 bogind

In case it helps narrow things down the full text of the error I see:

Click to expand!
Couldn't load plugin 'GlobeBuilder' due to an error when calling its classFactory() method 

TypeError: qRegisterResourceData(int, bytes, bytes, bytes): argument 2 has unexpected type 'str' 
Traceback (most recent call last):
  File "C:/PROGRA~1/QGIS3~1.10/apps/qgis/./python\qgis\utils.py", line 334, in _startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "C:/Users/Wil.Selwood/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\GlobeBuilder\__init__.py", line 35, in classFactory
    from .globe_builder import GlobeBuilder
  File "C:/PROGRA~1/QGIS3~1.10/apps/qgis/./python\qgis\utils.py", line 744, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/Wil.Selwood/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\GlobeBuilder\globe_builder.py", line 35, in 
    from .globe_builder_dialog import GlobeBuilderDialog
  File "C:/PROGRA~1/QGIS3~1.10/apps/qgis/./python\qgis\utils.py", line 744, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/Wil.Selwood/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\GlobeBuilder\globe_builder_dialog.py", line 38, in 
    os.path.dirname(__file__), 'globe_builder_dialog_base.ui'), resource_suffix='')
  File "C:/PROGRA~1/QGIS3~1.10/apps/qgis/./python\qgis\PyQt\uic\__init__.py", line 36, in __loadUiType
    return __PyQtLoadUiType(*args, **kwargs)
  File "C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib\site-packages\PyQt5\uic\__init__.py", line 201, in loadUiType
    exec(code_string.getvalue(), ui_globals)
  File "", line 180, in 
  File "C:/PROGRA~1/QGIS3~1.10/apps/qgis/./python\qgis\utils.py", line 744, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/Wil.Selwood/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\resources.py", line 1251, in 
    qInitResources()
  File "C:/Users/Wil.Selwood/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web\resources.py", line 1243, in qInitResources
    qt_resource_name, qt_resource_data)
TypeError: qRegisterResourceData(int, bytes, bytes, bytes): argument 2 has unexpected type 'str'


Python version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] 
QGIS version: 3.10.1-A Coruña A Coruña, ef24c526da 

Python Path:
C:/PROGRA~1/QGIS3~1.10/apps/qgis/./python
C:/Users/Wil.Selwood/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/Wil.Selwood/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/PROGRA~1/QGIS3~1.10/apps/qgis/./python/plugins
C:\Program Files\QGIS 3.10\bin\python37.zip
C:\PROGRA~1\QGIS3~1.10\apps\Python37\DLLs
C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib
C:\Program Files\QGIS 3.10\bin
C:\PROGRA~1\QGIS3~1.10\apps\Python37
C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib\site-packages
C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib\site-packages\win32
C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib\site-packages\win32\lib
C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib\site-packages\Pythonwin
C:/Users/Wil.Selwood/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/Wil.Selwood/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\qgis2web
C:\Users\Wil.Selwood\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins

emilyselwood avatar Jan 23 '20 14:01 emilyselwood

I finally managed to replicate the issue. After restarting the QGIS profile with all the plugins described in the Environment installed I got the same error even though the resources.py had bytes there instead of strings. I fixed this by removing the references to the resources from ui-file. Fix is coming shortly.

Joonalai avatar Jan 24 '20 05:01 Joonalai

It seems that this issue is not fixed after all. I got reporting of the case where this issue occurs with the Globe Builder 0.5.0 with two other plugins installed: qgis2web and OSMDownloader. After experimenting with this I got the same exception:

Click to expand!
Couldn't load plugin 'GlobeBuilder' due to an error when calling its classFactory() method 

TypeError: qRegisterResourceData(int, bytes, bytes, bytes): argument 2 has unexpected type 'str' 
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 334, in _startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "/home/j/.local/share/QGIS/QGIS3/profiles/tmp2/python/plugins/GlobeBuilder/__init__.py", line 35, in classFactory
    from .plugin import GlobeBuilder
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 744, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/j/.local/share/QGIS/QGIS3/profiles/tmp2/python/plugins/GlobeBuilder/plugin.py", line 30, in 
    from .globe_builder_dockwidget import GlobeBuilderDockWidget
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 744, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/j/.local/share/QGIS/QGIS3/profiles/tmp2/python/plugins/GlobeBuilder/globe_builder_dockwidget.py", line 41, in 
    os.path.dirname(__file__), 'globe_builder_dockwidget_base.ui'), resource_suffix='')
  File "/usr/lib/python3/dist-packages/qgis/PyQt/uic/__init__.py", line 36, in __loadUiType
    return __PyQtLoadUiType(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/PyQt5/uic/__init__.py", line 201, in loadUiType
    exec(code_string.getvalue(), ui_globals)
  File "", line 451, in 
  File "/usr/lib/python3/dist-packages/qgis/utils.py", line 744, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "/home/j/.local/share/QGIS/QGIS3/profiles/tmp2/python/plugins/qgis2web/resources.py", line 1251, in 
    qInitResources()
  File "/home/j/.local/share/QGIS/QGIS3/profiles/tmp2/python/plugins/qgis2web/resources.py", line 1243, in qInitResources
    qt_resource_name, qt_resource_data)
TypeError: qRegisterResourceData(int, bytes, bytes, bytes): argument 2 has unexpected type 'str'

Here the most significant part is:

File "/home/j/.local/share/QGIS/QGIS3/profiles/tmp2/python/plugins/qgis2web/resources.py", line 1251, in 
    qInitResources()
  File "/home/j/.local/share/QGIS/QGIS3/profiles/tmp2/python/plugins/qgis2web/resources.py", line 1243, in qInitResources

So it seems that other plugin (here qgis2web) is affecting loading of Globe Builder somehow. This can be found also in @emilyselwood's traceback. I found a temporary fix to this:

  1. Install Globe Builder plugin via Plugins dialog. If the error message does not appear, great. Otherwise copy the traceback and continue to next step.
  2. Go to Installed part in Plugins dialog
  3. Find out which plugin is mentioned in the traceback
  4. Deactivate the plugin mentioned in the traceback
  5. Activate Globe Builder and then the other plugin

Hope this helps. I will investigate the reason behind this a little later.

Joonalai avatar Apr 09 '20 05:04 Joonalai

@ianturton I also noticed plugin isochrones to cause this issue. Solution above.

Joonalai avatar Apr 09 '20 07:04 Joonalai

This might not be relevant anymore now that #13 is closed. Needs testing.

Joonalai avatar Nov 18 '20 11:11 Joonalai