Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install fails on Ubuntu with 3.10 #1

Open
ianturton opened this issue Jan 15, 2020 · 15 comments
Open

Install fails on Ubuntu with 3.10 #1

ianturton opened this issue Jan 15, 2020 · 15 comments
Assignees
Labels
bug Something isn't working

Comments

@ianturton
Copy link

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

@Joonalai
Copy link
Collaborator

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.

@bogind
Copy link

bogind commented Jan 15, 2020

@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.

@Joonalai
Copy link
Collaborator

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

@bogind
Copy link

bogind commented Jan 15, 2020

@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.

@Joonalai
Copy link
Collaborator

Alright, I will further investigate this.

@ianturton
Copy link
Author

ianturton commented Jan 15, 2020 via email

@Joonalai Joonalai self-assigned this Jan 21, 2020
@Joonalai Joonalai added the bug Something isn't working label Jan 21, 2020
@emilyselwood
Copy link

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

@Joonalai
Copy link
Collaborator

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.

@emilyselwood
Copy link

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.

@bogind
Copy link

bogind commented Jan 23, 2020

@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.

@emilyselwood
Copy link

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

@Joonalai
Copy link
Collaborator

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 Joonalai reopened this Apr 9, 2020
@Joonalai
Copy link
Collaborator

Joonalai commented Apr 9, 2020

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
Copy link
Collaborator

Joonalai commented Apr 9, 2020

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

@Joonalai
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants