loading external python modules?
#1
Hi,
i'm trying to load some python module inside xbmc script but nothing really works.
for example i'm trying this import:
from pysqlite2 import dbapi2 as sqlite3
and it fails with unknown module.

am i missing something?
thanks
Reply
#2
pysqlite2 isn't included with python 2.4.

XBMC uses python 2.4 always, regardless of what is on your system.
Always read the XBMC online-manual, FAQ and search and search the forum before posting.
For troubleshooting and bug reporting please read how to submit a proper bug report.

If you're interested in writing addons for xbmc, read docs and how-to for plugins and scripts ||| http://code.google.com/p/xbmc-addons/
Reply
#3
even though i have the pysqlie libs under the sitePackages of python 2.4?

i'm using linux and eclipse ide, if i run just the core of the script inside eclipse and set my interpretor as python 2.4 everything runs ok.

i guess coping the files to the local dir would solve the problem.
Reply
#4
As rwparris2 said, it doesn't matter what your system intrepenter is or if you have one installed Smile
XBMC uses it's own always.

You can however forcebly import system modules, although it's not crossplattform and it's more likely to break.

Here you can see how it's done: http://code.google.com/p/xbmc-addons/sou...n900&r=900

specifically:
sys.path.append("/usr/lib/python2.5/site-packages")

However, if you need to do it seriously rethink if it can't be done in another fashion, might even be worth feature request it aswell instead of system as it's evil Smile

Cheers,
Tobias
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#5
tanks both of u, saved me few hours of frustration.
Reply

Logout Mark Read Team Forum Stats Members Help
loading external python modules?0