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?

  • 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 – Nishtha Paul Apr 8 '19 at 15:52
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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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