import error python module xbmc xbmcgui (raspbian/xbian)
#1
Hello,

I run raspbmc (frodo) on raspberry pi.

I have the following problem: import of xbmc module fails with the following error message when I try to make some python scripts:

Python 2.7.3 (default, Jan 13 2013, 11:20:46)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import xbmc
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named xbmc

Same problem with xbmcgui, xbmcaddon.
Same problem on raspbmc and xbian.
Same problem as user or root.

I search all around the forums and do a lot of google searching... nowhere I found a solution.

I read that modules are visible only in the xbmc context. I guess that means that I have to loggon on a box where xbmc is up and running and scripting inside this box.

What I do :

Boot my raspberry with raspmc.
xbmc runs and works fine.
(I can play video/music with it. I can connect to the web interface from outside and ssh.)

I ssh to the box. OK
I can do shell commands etc.
I can succefully do http json rpc requests.

I fire python.
I've got the prompt.

>>> help('modules')

Please wait a moment while I gather a list of all available modules...

BaseHTTPServer argparse httplib sets
Bastion array ihooks setuptools
CDROM ast imageop sgmllib

(snip...)

_threading_local grp resource xml
_warnings gzip rexec xmllib
_weakref hashlib rfc822 xmlrpclib
_weakrefset heapq rlcompleter xxsubtype
abc hmac robotparser zipfile
aifc hotshot runpy zipimport
antigravity htmlentitydefs sched zlib
anydbm htmllib select

But :
>>> import xbmc
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named xbmc


If anybody knows the solution, please help me.

Thanks a lot.
Reply
#2
the XBMC modules are only available through XBMC(ie built in.) They are not usable from an external python
Reply
#3
Hello,

I don't understand exactly what it means.

When I log with ssh into the box where XMBC is running, can I access to the modules or not?

Or do you mean that only XMBC when it runs scripts (at startup, etc) can access to the modules?

If it is the case, how to test and debug?

Regards
Reply
#4
Hi, i'm also stuck at pretty much this same question.
I made a mod of an existing script, that should run ok, but im stuck at not knowing how to run it as xbmc.

Someone said i should just paste my script to /home/xbmc/.xbmc/scripts/autoexec.py
But this folder/file does not exist on my RaspberryPi installation, so now im just clueless...
Reply
#5
(2013-01-28, 19:26)eccehomo Wrote: Hello,

I don't understand exactly what it means.

When I log with ssh into the box where XMBC is running, can I access to the modules or not?

Or do you mean that only XMBC when it runs scripts (at startup, etc) can access to the modules?

If it is the case, how to test and debug?

Regards

The modules are only available to the Python Addon engine inside XBMC.

This document might be useful -> http://code.google.com/p/xbmc-gpodder-in...loads/list


(2013-01-28, 23:26)FreshPeace Wrote: Hi, i'm also stuck at pretty much this same question.
I made a mod of an existing script, that should run ok, but im stuck at not knowing how to run it as xbmc.

Someone said i should just paste my script to /home/xbmc/.xbmc/scripts/autoexec.py
But this folder/file does not exist on my RaspberryPi installation, so now im just clueless...

See the link above.

Also Python scripts go inside the /home/.xbmc/addons folder

Reply
#6
Hi giftie,

Thanks a lot for the information. My mind is now in peace!

May be it could be usefull to add a link to this doc within the how-to script for beginner.

Really it's not obvious to understand this point.

My skill in english && wiki && xbmc is not enough high to do this myself.

Regards
Reply

Logout Mark Read Team Forum Stats Members Help
import error python module xbmc xbmcgui (raspbian/xbian)0
This forum uses Lukasz Tkacz MyBB addons.