3

I already followed this tutorial and been through the steps. https://github.com/qgis/QGIS/wiki/Plugin-migration-to-QGIS-3 and https://gisforthought.com/updating-a-plugin-from-qgis-2-to-qgis-3/

I make some changes and started to track down the last errors. But im lost with this one:

TypeError: qRegisterResourceData(int, bytes, bytes, bytes): argument 2 has unexpected type 'str' 

I have the following traceback:

Traceback (most recent call last):
  File "C:/PROGRA~1/QGIS3~1.0/apps/qgis/./python\qgis\utils.py", line 336, in startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "C:/Users/Lars/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\_plugin\__init__.py", line 5, in classFactory
    from ._plugin_TEST import _plugin_TEST
  File "C:/PROGRA~1/QGIS3~1.0/apps/qgis/./python\qgis\utils.py", line 664, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/Lars/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\_plugin\_plugin_TEST.py", line 28, in 
    from . import resources
  File "C:/PROGRA~1/QGIS3~1.0/apps/qgis/./python\qgis\utils.py", line 664, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/Lars/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\_plugin\resources.py", line 85, in 
    qInitResources()
  File "C:/Users/Lars/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\_plugin\resources.py", line 80, in qInitResources
    QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)
TypeError: qRegisterResourceData(int, bytes, bytes, bytes): argument 2 has unexpected type 'str'


Python version: 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] 
QGIS version: 3.0.0-Girona Girona, 001c80b0c3 

Any leads or solutions?

1
  • I am also having the same error. The command below is showing the error ...\apps\Python36\Scripts\pyrcc5.bat -o resources.py resources.qrc ERROR Traceback (most recent call last): File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\PROGRA~1\QGIS3~1.4\apps\Python37\lib\site-packages\PyQt5\pyrcc_main.py", line 21, in <module> from PyQt5.QtCore import PYQT_VERSION_STR, QDir, QFile ImportError: DLL load failed: The specified mod Apr 8, 2019 at 15:52

1 Answer 1

3

Your "resources.py" presumably is for python2. You must generate a new file for python3

For example Windows: ...\apps\Python36\Scripts\pyrcc5.bat -o resources.py resources.qrc

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.