XBMC not recognising $PYTHONPATH?
#1
Hi,

I'm following the instructions to get a remote debugger working:

http://wiki.xbmc.org/index.php?title=HOW...th_Eclipse

One of the issues is getting XBMC to recognise the path /usr/share/xbmc/system/python/Lib, so that debugging can take place.

I can get the import to work in python:

Code:
$ export PYTHONPATH="/usr/share/xbmc/system/python/Lib"
$ python
Python 2.7.3 (default, Sep 26 2012, 21:51:14)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pysrc.pydevd
>>> pysrc.pydevd.__file__
'/usr/share/xbmc/system/python/Lib/pysrc/pydevd.py'

But it doesn't work in XBMC. A pprint dump of sys.path shows that the path specified in $PYTHONPATH isn't picked up.

Instead I have to use...

Code:
sys.path.append('/usr/share/xbmc/system/python/Lib')

...to get the debugger working. I don't like this much.

It may be my misunderstanding of python, but I'd expect paths I add to $PYTHONPATH to be picked up by xbmc.

Also I'm surprised that the path "/usr/share/xbmc/system/python/Lib" isn't already in xbmc's sys.path, since this seems to be somewhere it is reasonable to expect code to be.
Reply
#2
OK I think it's more my misunderstanding of linux.

$PYTHONPATH is only available to xbmc if you launch xbmc from a command line (ie cause the .bashrc to get called)

Calling xbmc from a launcher (eg Unity, Cinnamon) won't mean the variable is set, because .bashrc doesn't get hit.

So anyway. It would be awesome if "/usr/share/xbmc/system/python/Lib" was already on the system path so I don't have to crowbar it in.
Reply
#3
this path is empty, xbmc does not ship or use its own internal python anymore(on linux).
Instead the system python installation is used. So there is no need to include this dir.

to include pydev, it should be enough to put it in your addon dir or a system wide python dir.
Reply
#4
Thanks for the info. I pulled that path from a wiki entry, I'll update it to reflect what you said.

Anyway you read your mind, I was thinking of putting the pydev debug stuff in the addons folder.
Reply

Logout Mark Read Team Forum Stats Members Help
XBMC not recognising $PYTHONPATH?0