error with addon on python 3
#1
Hello, hope somebody can point me in the right direction. Decided to check compatibility of my addon(s) with python 3, did 2to3 and really only few things were changed. But when It starts I get the error something to do with PIL:
Quote:10:29:01.630 T:21284   ERROR: C:\Program Files (x86)\KodiP3\addons\script.module.pil\lib\PIL\Image.py:81: RuntimeWarning: The _imaging extension was built for another version of Python.
                                              RuntimeWarning
10:29:01.632 T:21284   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <class 'ImportError'>
                                            Error Contents: Module use of python27.dll conflicts with this version of Python.
                                            Traceback (most recent call last):
                                              File "C:\Program Files (x86)\KodiP3\portable_data\addons\service.yeemee\service.py", line 27, in <module>
                                                from PIL import Image
                                              File "C:\Program Files (x86)\KodiP3\addons\script.module.pil\lib\PIL\Image.py", line 66, in <module>
                                                from PIL import _imaging as core
                                            ImportError: Module use of python27.dll conflicts with this version of Python.
                                            -->End of Python script error report<--
Reply
#2
Currently, in Python 3-based Kodi builds some binary Python modules are either missing or incorrectly built like in this case. This should be fixed in the future. As a temporary workaround you can download a compiled Python 3.6 wheel for your platform from PyPI and replace the contents of script.module.pil/lib folder in your Kodi installation. A Python .whl package is just a ZIP file but with different extension.
Reply
#3
Thanx, will try. After I removed PIL (because it is really not needed in my addon except for debugging purposes) I get a lot of hashlib errors, but my addon is not mentioned in any of the lines... is this something that aslo has yet to be implemented in kodi or my error?
Quote:10:44:18.077 T:10444   DEBUG: CPythonInvoker(1, C:\Program Files (x86)\KodiP3\portable_data\addons\service.yeemee\service.py): the source file to load is "C:\Program Files (x86)\KodiP3\portable_data\addons\service.yeemee\service.py"
10:44:18.077 T:10444   DEBUG: CPythonInvoker(1, C:\Program Files (x86)\KodiP3\portable_data\addons\service.yeemee\service.py): setting the Python path to C:\Program Files (x86)\KodiP3\portable_data\addons\service.yeemee;C:\Program Files (x86)\KodiP
10:44:18.077 T:10444   DEBUG: CPythonInvoker(1, C:\Program Files (x86)\KodiP3\portable_data\addons\service.yeemee\service.py): entering source directory C:\Program Files (x86)\KodiP3\portable_data\addons\service.yeemee
10:44:18.088 T:10444   DEBUG: CPythonInvoker(1, C:\Program Files (x86)\KodiP3\portable_data\addons\service.yeemee\service.py): instantiating addon using automatically obtained id of "service.yeemee" dependent on version 2.1.0 of the xbmc.python api
10:44:18.360 T:10444   ERROR: ERROR:root:code for hash blake2b was not found.
                                            Traceback (most recent call last):
                                              File "<frozen importlib._bootstrap>", line 879, in _find_spec
                                            AttributeError: '_SixMetaPathImporter' object has no attribute 'find_spec'
                                            
                                            During handling of the above exception, another exception occurred:
                                            
                                            Traceback (most recent call last):
                                              File "C:\Program Files (x86)\KodiP3\system\python\Lib\hashlib.py", line 243, in <module>
                                                globals()[__func_name] = __get_hash(__func_name)
                                              File "C:\Program Files (x86)\KodiP3\system\python\Lib\hashlib.py", line 119, in __get_openssl_constructor
                                                return __get_builtin_constructor(name)
                                              File "C:\Program Files (x86)\KodiP3\system\python\Lib\hashlib.py", line 113, in __get_builtin_constructor
                                                raise ValueError('unsupported hash type ' + name)
                                            ValueError: unsupported hash type blake2b
10:44:18.360 T:10444   DEBUG: .
10:44:18.363 T:10444   ERROR: ERROR:root:code for hash blake2s was not found.
                                            Traceback (most recent call last):
                                              File "<frozen importlib._bootstrap>", line 879, in _find_spec
                                            AttributeError: '_SixMetaPathImporter' object has no attribute 'find_spec'
                                            
                                            During handling of the above exception, another exception occurred:
                                            
                                            Traceback (most recent call last):
                                              File "C:\Program Files (x86)\KodiP3\system\python\Lib\hashlib.py", line 243, in <module>
                                                globals()[__func_name] = __get_hash(__func_name)
                                              File "C:\Program Files (x86)\KodiP3\system\python\Lib\hashlib.py", line 119, in __get_openssl_constructor
                                                return __get_builtin_constructor(name)
                                              File "C:\Program Files (x86)\KodiP3\system\python\Lib\hashlib.py", line 113, in __get_builtin_constructor
                                                raise ValueError('unsupported hash type ' + name)
                                            ValueError: unsupported hash type blake2s
10:44:18.363 T:10444   DEBUG: .
10:44:18.367 T:10444   ERROR: ERROR:root:code for hash sha3_224 was not found.
                                            Traceback (most recent call last):
                                              File "<frozen importlib._bootstrap>", line 879, in _find_spec
                                            AttributeError: '_SixMetaPathImporter' object has no attribute 'find_spec'
                                            
                                            During handling of the above exception, another exception occurred:
                                            
                                            Traceback (most recent call last):
                                              File "C:\Program Files (x86)\KodiP3\system\python\Lib\hashlib.py", line 121, in __get_openssl_constructor
                                                f = getattr(_hashlib, 'openssl_' + name)
                                            AttributeError: module '_hashlib' has no attribute 'openssl_sha3_224'
                                            
                                            During handling of the above exception, another exception occurred:
                                            
                                            Traceback (most recent call last):
                                              File "C:\Program Files (x86)\KodiP3\system\python\Lib\hashlib.py", line 243, in <module>
                                                globals()[__func_name] = __get_hash(__func_name)
                                              File "C:\Program Files (x86)\KodiP3\system\python\Lib\hashlib.py", line 128, in __get_openssl_constructor
                                                return __get_builtin_constructor(name)
                                              File "C:\Program Files (x86)\KodiP3\system\python\Lib\hashlib.py", line 113, in __get_builtin_constructor
                                                raise ValueError('unsupported hash type ' + name)
                                            ValueError: unsupported hash type sha3_224
10:44:18.367 T:10444   DEBUG: .
10:44:18.370 T:10444   ERROR: ERROR:root:code for hash sha3_256 was not found.
                                            Traceback (most recent call last):
                                              File "<frozen importlib._bootstrap>", line 879, in _find_spec
                                            AttributeError: '_SixMetaPathImporter' object has no attribute 'find_spec'
                                            
                                            During handling of the above exception, another exception occurred:
                                            
                                            Traceback (most recent call last):
                                              File "C:\Program Files (x86)\KodiP3\system\python\Lib\hashlib.py", line 121, in __get_openssl_constructor
                                                f = getattr(_hashlib, 'openssl_' + name)
                                            AttributeError: module '_hashlib' has no attribute 'openssl_sha3_256'
                                            
                                            During handling of the above exception, another exception occurred:
                                            
                                            Traceback (most recent call last):
                                              File "C:\Program Files (x86)\KodiP3\system\python\Lib\hashlib.py", line 243, in <module>
                                                globals()[__func_name] = __get_hash(__func_name)
                                              File "C:\Program Files (x86)\KodiP3\system\python\Lib\hashlib.py", line 128, in __get_openssl_constructor
                                                return __get_builtin_constructor(name)
                                              File "C:\Program Files (x86)\KodiP3\system\python\Lib\hashlib.py", line 113, in __get_builtin_constructor
                                                raise ValueError('unsupported hash type ' + name)
                                            ValueError: unsupported hash type sha3_256
10:44:18.370 T:10444   DEBUG: .
10:44:18.373 T:10444   ERROR: ERROR:root:code for hash sha3_384 was not found.
                                            Traceback (most recent call last):
                                              File "<frozen importlib._bootstrap>", line 879, in _find_spec
                                            AttributeError: '_SixMetaPathImporter' object has no attribute 'find_spec'
                                            
                                            During handling of the above exception, another exception occurred:
                                            
                                            Traceback (most recent call last):
                                              File "C:\Program Files (x86)\KodiP3\system\python\Lib\hashlib.py", line 121, in __get_openssl_constructor
                                                f = getattr(_hashlib, 'openssl_' + name)
                                            AttributeError: module '_hashlib' has no attribute 'openssl_sha3_384'
                                            
                                            During handling of the above exception, another exception occurred:
                                            
                                            Traceback (most recent call last):
                                              File "C:\Program Files (x86)\KodiP3\system\python\Lib\hashlib.py", line 243, in <module>
                                                globals()[__func_name] = __get_hash(__func_name)
                                              File "C:\Program Files (x86)\KodiP3\system\python\Lib\hashlib.py", line 128, in __get_openssl_constructor
                                                return __get_builtin_constructor(name)
                                              File "C:\Program Files (x86)\KodiP3\system\python\Lib\hashlib.py", line 113, in __get_builtin_constructor
                                                raise ValueError('unsupported hash type ' + name)
                                            ValueError: unsupported hash type sha3_384
10:44:18.373 T:10444   DEBUG: .
10:44:18.376 T:10444   ERROR: ERROR:root:code for hash sha3_512 was not found.
                                            Traceback (most recent call last):
                                              File "<frozen importlib._bootstrap>", line 879, in _find_spec
                                            AttributeError: '_SixMetaPathImporter' object has no attribute 'find_spec'
                                            
                                            During handling of the above exception, another exception occurred:
                                            
                                            Traceback (most recent call last):
                                              File "C:\Program Files (x86)\KodiP3\system\python\Lib\hashlib.py", line 121, in __get_openssl_constructor
                                                f = getattr(_hashlib, 'openssl_' + name)
                                            AttributeError: module '_hashlib' has no attribute 'openssl_sha3_512'
                                            
                                            During handling of the above exception, another exception occurred:
                                            
                                            Traceback (most recent call last):
                                              File "C:\Program Files (x86)\KodiP3\system\python\Lib\hashlib.py", line 243, in <module>
                                                globals()[__func_name] = __get_hash(__func_name)
                                              File "C:\Program Files (x86)\KodiP3\system\python\Lib\hashlib.py", line 128, in __get_openssl_constructor
                                                return __get_builtin_constructor(name)
                                              File "C:\Program Files (x86)\KodiP3\system\python\Lib\hashlib.py", line 113, in __get_builtin_constructor
                                                raise ValueError('unsupported hash type ' + name)
                                            ValueError: unsupported hash type sha3_512
10:44:18.376 T:10444   DEBUG: .
10:44:18.379 T:10444   ERROR: ERROR:root:code for hash shake_128 was not found.
                                            Traceback (most recent call last):
                                              File "<frozen importlib._bootstrap>", line 879, in _find_spec
                                            AttributeError: '_SixMetaPathImporter' object has no attribute 'find_spec'
                                            
                                            During handling of the above exception, another exception occurred:
                                            
                                            Traceback (most recent call last):
                                              File "C:\Program Files (x86)\KodiP3\system\python\Lib\hashlib.py", line 121, in __get_openssl_constructor
                                                f = getattr(_hashlib, 'openssl_' + name)
                                            AttributeError: module '_hashlib' has no attribute 'openssl_shake_128'
                                            
                                            During handling of the above exception, another exception occurred:
                                            
                                            Traceback (most recent call last):
                                              File "C:\Program Files (x86)\KodiP3\system\python\Lib\hashlib.py", line 243, in <module>
                                                globals()[__func_name] = __get_hash(__func_name)
                                              File "C:\Program Files (x86)\KodiP3\system\python\Lib\hashlib.py", line 128, in __get_openssl_constructor
                                                return __get_builtin_constructor(name)
                                              File "C:\Program Files (x86)\KodiP3\system\python\Lib\hashlib.py", line 113, in __get_builtin_constructor
                                                raise ValueError('unsupported hash type ' + name)
                                            ValueError: unsupported hash type shake_128
10:44:18.379 T:10444   DEBUG: .
10:44:18.382 T:10444   ERROR: ERROR:root:code for hash shake_256 was not found.
                                            Traceback (most recent call last):
                                              File "<frozen importlib._bootstrap>", line 879, in _find_spec
                                            AttributeError: '_SixMetaPathImporter' object has no attribute 'find_spec'
                                            
                                            During handling of the above exception, another exception occurred:
                                            
                                            Traceback (most recent call last):
                                              File "C:\Program Files (x86)\KodiP3\system\python\Lib\hashlib.py", line 121, in __get_openssl_constructor
                                                f = getattr(_hashlib, 'openssl_' + name)
                                            AttributeError: module '_hashlib' has no attribute 'openssl_shake_256'
                                            
                                            During handling of the above exception, another exception occurred:
                                            
                                            Traceback (most recent call last):
                                              File "C:\Program Files (x86)\KodiP3\system\python\Lib\hashlib.py", line 243, in <module>
                                                globals()[__func_name] = __get_hash(__func_name)
                                              File "C:\Program Files (x86)\KodiP3\system\python\Lib\hashlib.py", line 128, in __get_openssl_constructor
                                                return __get_builtin_constructor(name)
                                              File "C:\Program Files (x86)\KodiP3\system\python\Lib\hashlib.py", line 113, in __get_builtin_constructor
                                                raise ValueError('unsupported hash type ' + name)
                                            ValueError: unsupported hash type shake_256
10:44:18.382 T:10444   DEBUG: .
10:44:18.809 T:10444   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <class 'AttributeError'>
                                            Error Contents: 'str' object has no attribute 'decode'
                                            -->End of Python script error report<--
10:44:18.809 T:10444   ERROR: Traceback (most recent call last):
10:44:18.809 T:10444   ERROR:   File "C:\Program Files (x86)\KodiP3\system\python\Lib\traceback.py", line 117, in format_exception
10:44:18.812 T:10444   ERROR: type(value), value, tb, limit=limit).format(chain=chain))
10:44:18.812 T:10444   ERROR:   File "C:\Program Files (x86)\KodiP3\system\python\Lib\traceback.py", line 465, in __init__
10:44:18.813 T:10444   ERROR: if (exc_value and exc_value.__cause__ is not None
10:44:18.813 T:10444   ERROR: AttributeError
10:44:18.813 T:10444   ERROR: :
10:44:18.813 T:10444   ERROR: 'str' object has no attribute '__cause__'
10:44:18.813 T:10444   ERROR: CPythonInvoker(1, C:\Program Files (x86)\KodiP3\portable_data\addons\service.yeemee\service.py): failed to run the gc to clean up after running prior to shutting down the Interpreter
Reply
#4
This issue has already been discussed in the topic next to yours. In short, you can ignore hash-related errors an put your stings in order.
Reply
#5
(2018-02-01, 11:53)DaLanik Wrote: Thanx, will try.
Please use websites like Pastebin.com for long(er) text sections. We prefer not to burden our forum database any more than necessary. Smile
Reply
#6
(2018-02-01, 12:11)Roman_V_M Wrote: is issue has already been discussed in the topic next to yours. In short, you can ignore hash-related errors an put your stings in order.
 Ahh, yes, nice. It was enough to remove
Code:
.decode :)
Reply
#7
Sorry, I thought it is not too long Smile Won't happen again.
Reply
#8
Again me Smile I am not sure this is python 3 problem, maybe it is kodi v18 or only the alpha with p3 problem; anyways, I have a settings file, and in it values have defaults, so when settings don't exist and you run addon for the first time, those default values should be created, right?

i.e. <setting id="Lat" type="text" default="50.1167" visible="false" /> will create a line in settings with     <setting id="Lat" value="50.1167" />, right? And it kinda works, but when I have a line:

<setting id="timeOnStart" type="time" label="32093" default="20:00" visible="eq(-1,1)" enable="eq(-1,1)" />

it creates a line in settings like this:

<setting id="timeOnStart" default="true"></setting>
as opposed to the kodi v17:
<setting id="timeOnStart" value="20:00" />

trueHuh? What am I missing here?
Reply
#9
it's not related to the py3 migration, but a result of the addon settings change in kodi leia.

default="true" means the setting hasn't been changed from it's original value.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#10
OK, but the thing is that the setting is empty! Up to v17 it was automatically setting it to the default value! Is there a change description somewhere? I looked at the wiki and googled but coudn't find anything. Does that mean I have to write the default values myself?
Reply
#11
nothing should be done at your end, though the new settings implementation is known to have some issue.
perhaps this is one of those. i'll look into it later today.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#12
found a bit of time to look into it. seems it now expects the time value in HH:MM:SS format...
<setting id="timeOnStart" type="time" label="32093" default="20:00:00" visible="eq(-1,1)" enable="eq(-1,1)" />



this is something that needs to fixed in kodi imo.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#13
Hell\p please Im usin xenon buid


ERROR: EXCEPTION Thrown (Python CppException) : -->Python callback/script returned the following error<-- - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS! Error Type: <type 'exceptions.ValueError'> Error Contents: invalid literal for float(): 0 M Traceback (most recent call last): File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.program.thechef18/default.py", line 29, in dispatcher.dispatch(_handle, _params) File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.program.thechef18/resources/libs/common/router.py", line 126, in dispatch menu.system_info() File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.program.thechef18/resources/libs/gui/menu.py", line 228, in system_info storage_free = data[8] if 'Una' in data[8] else tools.convert_size(int(float(data[8][:-8])) * 1024 * 1024) ValueError: invalid literal for float(): 0 M
android
Reply
#14
@Veytiarol - then you're using a piracy build which violates our forum rules (wiki) and is entirely unsupported here.

Please go and actually read the forum rules (wiki) that you accepted and agreed to abide by when you signed up here, especially the piracy policy (wiki) part.

No support is available here for any device that contains such junk.
|Banned add-ons (wiki)|Forum rules (wiki)|VPN policy (wiki)|First time user (wiki)|FAQs (wiki) Troubleshooting (wiki)|Add-ons (wiki)|Free content (wiki)|Debug Log (wiki)|

Kodi Blog Posts
Reply

Logout Mark Read Team Forum Stats Members Help
error with addon on python 30