Saturday 30 April 2016

python - updating plugin from qgis 2 to 3. qRegisterResourceData . argument 2 has unexpected type 'str'


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?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...