Help with simple importing error
#1
Hello,

I have what seems to be a simple yet confounding problem.
In my plugin i have several import calls:
Code:
from xbmcswift2 import Plugin
import os, sys, xbmc, xbmcvfs
import pyxbmct.addonwindow as pyxbmct

But i get the following error:
Code:
ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.ImportError'>
                                            Error Contents: No module named pyxbmct.addonwindow
                                            Traceback (most recent call last):
                                              File "XXX/addon.py", line 3, in <module>
                                                import pyxbmct.addonwindow as pyxbmct
                                            ImportError: No module named pyxbmct.addonwindow

But the problem is I can clearly see by browsing to my add ons folder that pyxbmct is installed. Everything else seems to be working just fine. I've tried uninstalling and reinstalling it, deleting the addons.db, but i still can't seem to get the import to work. Is there some way I can check to see if Kodi is adding the path correctly?

Any help is greatly appreciated.

Thanks!
Reply
#2
You need to add it to your addon.xml as dependency
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#3
Thanks Martin.

That wasn't exactly the problem, but you helped me find what the actual problem was. My original addon.xml had the following:
Code:
<import addon="xbmc.python" version="2.1.0"/>
    <import addon="script.module.xbmcswift2" version="2.4.0"/>
    <import addon="script.module.pyxbmct" version="1.1.4"/>

I think it was a typo, after I updated the version for xbmc.python to "2.14.0" (the same version as the one listed in pyxbmct as required), it worked.

Thanks!
Reply
#4
Hmm that shouldn't matter really. We only import modules that you have in addon.xml and don't rely on the version number.
Version number is only to check if you have at least the minimum required but shouldn't stop it running
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#5
(2015-06-02, 07:22)Martijn Wrote: Hmm that shouldn't matter really. We only import modules that you have in addon.xml and don't rely on the version number.
Version number is only to check if you have at least the minimum required but shouldn't stop it running

Doesn't Kodi shows "Dependency is not met?" warning in that case?

Anyway, being the author of PyXBMCt, should I bump xbmc.python version in PyXBMCt to the current one (2.20.0 IIRC)? PyXBMCt is compatible with Kodi/Isengard.
Reply
#6
(2015-06-02, 13:09)Roman_V_M Wrote:
(2015-06-02, 07:22)Martijn Wrote: Hmm that shouldn't matter really. We only import modules that you have in addon.xml and don't rely on the version number.
Version number is only to check if you have at least the minimum required but shouldn't stop it running

Doesn't Kodi shows "Dependency is not met?" warning in that case?

Anyway, being the author of PyXBMCt, should I bump xbmc.python version in PyXBMCt to the current one (2.20.0 IIRC)? PyXBMCt is compatible with Kodi/Isengard.

if you bump it won't be compatible any more with previous versions. So up to you Smile
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#7
ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.ImportError'>
Error Contents: No module named pyxbmct.addonwindow
Traceback (most recent call last):
File "/home/gummball8/.kodi/addons/script.areswizard/default.py", l

In my circumstance I found that script.module.pyxbmct from addons was missing or had been deleted. From my kodi backup I replaced the script.module.pyxbmct back into addons folder and this fixed the error generated by opening the ares wizard.

hope this helps
Reply
#8
Hi Guys,

I am trying to add youtube plugin in kodi 18 and the log give me this:
00:06:56.391 T:44924   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.RuntimeError'>
                                            Error Contents: No valid addon id could be obtained. None was passed and the script wasn't executed in a normal xbmc manner.
                                            Traceback (most recent call last):
                                              File "C:\Users\mohammadsaeed\AppData\Roaming\Kodi\plugin.video.youtube\default.py", line 4, in <module>
                                                from resources.lib import youtube
                                              File "C:\Users\mohammadsaeed\AppData\Roaming\Kodi\plugin.video.youtube\resources\lib\youtube\__init__.py", line 5, in <module>
                                                from .provider import Provider
                                              File "C:\Users\mohammadsaeed\AppData\Roaming\Kodi\plugin.video.youtube\resources\lib\youtube\provider.py", line 8, in <module>
                                                from resources.lib.youtube.client import YouTube
                                              File "C:\Users\mohammadsaeed\AppData\Roaming\Kodi\plugin.video.youtube\resources\lib\youtube\client\__init__.py", line 5, in <module>
                                                from .youtube import YouTube
                                              File "C:\Users\mohammadsaeed\AppData\Roaming\Kodi\plugin.video.youtube\resources\lib\youtube\client\youtube.py", line 4, in <module>
                                                from .login_client import LoginClient
                                              File "C:\Users\mohammadsaeed\AppData\Roaming\Kodi\plugin.video.youtube\resources\lib\youtube\client\login_client.py", line 7, in <module>
                                                from __config__ import api, youtube_tv, keys_changed
                                              File "C:\Users\mohammadsaeed\AppData\Roaming\Kodi\plugin.video.youtube\resources\lib\youtube\client\__config__.py", line 8, in <module>
                                                __context = __Context()
                                              File "C:\Users\mohammadsaeed\AppData\Roaming\Kodi\plugin.video.youtube\resources\lib\kodion\impl\xbmc\xbmc_context.py", line 29, in __init__
                                                self._addon = xbmcaddon.Addon()
                                            RuntimeError: No valid addon id could be obtained. None was passed and the script wasn't executed in a normal xbmc manner.
                                            -->End of Python script error report<--

what is the problem here?

Thanks
Reply
#9
looks like you manually copied to addon to some folder instead of installing it through kodi.
on top of that, i think you're also trying to execute the addon an in incorrect way.
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
(2018-08-29, 23:10)mohammadsaeed01 Wrote: what is the problem here?
The problem is that you are hijacking someone else's 2016 topic as your own for no good reason.
You already have your own topic on the whole Youtube addon not working.
Reply
#11
Big Grin yes I am there
Reply

Logout Mark Read Team Forum Stats Members Help
Help with simple importing error0