![]() |
ImportError: No module named xbmc - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93) +--- Thread: ImportError: No module named xbmc (/showthread.php?tid=326044) |
ImportError: No module named xbmc - jose383 - 2017-12-27 I'm trying using the xmbc library to my code on python, exactly y need the method xmbc.getCondVisibility('Player.HasMedia') to know that kodi is treaming a file.I write their imports but when I run the file, this say: ImportError: No module named xbmc The code:
the source: https://forum.kodi.tv/showthread.php?tid=244430 http://kodi.wiki/view/List_of_boolean_conditions If I edit line xbmc for kodi, I get this error: ERROR: AttributeError: 'module' object has no attribute 'getCondVisibility' I run this program in autoexec.py in userdata folder RE: ImportError: No module named xbmc - ultraman - 2017-12-27 You have a typo: xmbc must be xbmc:
RE: ImportError: No module named xbmc - jose383 - 2017-12-27 (2017-12-27, 14:53)ultraman Wrote: You have a typo: xmbc must be xbmc:It isn`t the problem, In the original code I write xbmc, the problem is the error when I write: import xbmc ¿How I can use Player.HasMedia in python code for execute via console? RE: ImportError: No module named xbmc - ultraman - 2017-12-27 Well, with xbmc it works. But you can't import xbmc module running python script directly from console - it must be run from Kodi. You can try Of course you can use other file not autoexec.py. What you need is probably service addon. RE: ImportError: No module named xbmc - jose383 - 2017-12-27 (2017-12-27, 15:33)ultraman Wrote: Well, with xbmc it works. But you can't import xbmc module running python script directly from console - it must be run from Kodi.I don´t understant you, I want that autoexec.py it to run automatically and be able to know that kodi is streaming video RE: ImportError: No module named xbmc - ultraman - 2017-12-27 autoexec.py you posted works (I test it). Not sure if loop there is good idea that's why I propose to you service addon which runs in background. RE: ImportError: No module named xbmc - jose383 - 2017-12-27 (2017-12-27, 16:13)ultraman Wrote: autoexec.py you posted works (I test it). Not sure if loop there is good idea that's why I propose to you service addon which runs in background.ok, thanks, I will do service addon: http://kodi.wiki/view/Add-on_development http://kodi.wiki/view/Service_addons I understand that it is not possible to do what I want with the autoexec.py, if someone who reads the publication knows how to do it, please write it RE: ImportError: No module named xbmc - Roman_V_M - 2017-12-27 You can't access xbmc* modules from outside Kodi. If you need to control Kodi state from an external application, you can use JSON RPC. |