External Python modules not loaded by internal Python Interpreter?
#1
(Ubuntu 10.04 Dharma SVN:35648)

According to the readme.txt in /usr/share/xbmc/system/python, a lib (or Lib?) dir placed there could be used to install extra Python modules, as also suggested by the Debugging with Eclipse wiki page http://wiki.xbmc.org/index.php?title=HOW...th_Eclipse

Actually, Python Interpreter does not add it to its Python path, making it impossible to use, as shown by debug logs:

Quote:09:39:35 T:139706163328784 M:854429696 NOTICE: -->Python Interpreter Initialized<--
09:39:35 T:139706163328784 M:854429696 DEBUG: Process - The source file to load is /home/bibi/.xbmc/addons/plugin.audio.tutorial/default.py
09:39:35 T:139706163328784 M:854429696 DEBUG: Process - Setting the Python path to /home/bibi/.xbmc/addons/plugin.audio.tutorial:/home/bibi/.xbmc/addons/script.module.simplejson/lib:/home/bibi/.xbmc/addons/script.module.beautifulsoup/lib:/usr/lib/xbmc/addons/script.module.pil/lib:/home/bibi/.xbmc/addons/script.module.elementtree/lib:/usr/lib/xbmc/addons/script.module.pysqlite/lib:/usr/lib/xbmc/system/python/python24.zip:/usr/share/xbmc/system/python/lib/python24.zip:/usr/share/xbmc/system/python/lib/python2.4/:/usr/share/xbmc/system/python/lib/python2.4/plat-linux2:/usr/share/xbmc/system/python/lib/python2.4/lib-tk:/usr/share/xbmc/system/python/lib/python2.4/lib-dynload

and btw in my installation (PPA) the /usr/share/xbmc/system/python contains the readme.txt only, without any dir.

Any hints about what is going on there?

Thanks!
Reply
#2
i would personally reccommend either putting extra python modules straight in the addon folder with the default.py (best for testing), or packaging it like the quote below (best for releasing)


Quote:script.module.mechanize

my plugin required the mechanize python module, so i copied this design from the PIL module.
create one of these for each library/module you are talking about, and get them hosted in the/a repo.

then in your script's addon.xml, under the <requires> heading put the equivalent of this:
<import addon="script.module.mechanize" version="0.2.4"/>
for each external thing.

they get automatically downloaded when an addon requiring them is downloaded.

i've never used eclipse to debug before, so i'm not sure what the wiki is referring to. good luck
Reply

Logout Mark Read Team Forum Stats Members Help
External Python modules not loaded by internal Python Interpreter?0