OS X Python interpreter
#1
Hi folks Wink,

I have been trying to install my python script add-on into the XBMC Eden running on my Mac, but I seem not to be able to run it even though it is running on my Linux machine.

The issue is that my Eden-release version of XBMC is using an embedded python interpreter rather than the native python interpreter as it is happening on my Linux machine.In order for my add-on to work properly I have to install the Crypto Python module and use the Cipher functions. I have installed the Crypto module into my native python interpreter libraries via "python setup.py install", and it seems to work for the terminal version, but as soon as I launch my add-on this will not start due to being not capable to load the module

Does anybody have a solution for this? Can I force a pre-compiled XBMC Eden version for Mac to use the native Python interpreter or should I compile it myself?

Thanks in advance!

Efren
Reply
#2
The safest way is to embed these modules on your addon (.pyd, .egg files or whatever), and then ensure XBMC's interpreter is able to find them by setting their path via sys.path.append.

Regards,

Mikel
Reply
#3
Hi,

Thank you for your response mazkolain, but this is not a regular xbmc module. This is a python ciphering module with .so files inside. It is not only python scripts, so I think this is a little more complicated than than
Or.... not. I solved it by copying everything into the same folder, but anyway I'd like to know how to force XBMC to work with the native python interpreter...
Reply
#4
Don't know if it's possible to tell XBMC to use another interpreter, but anyway, I think it's better for an addon to provide all the dependencies instead of relying some system dependent component.

It has the drawback that if it it's going to be a multi-platform addon you have to provide all the OS and arch variants of this module, but you have the confidence that will work out of the box, without requiring users to install anything.
Reply
#5
I've seen a lot of talk about XBMC using the system python installation, but in my experience, it's still using the builtin version.

It's worth noting that you CAN install modules into xbmc's interpreter, found at C:\Program Files (x86)\XBMC\system\python on Windows. The problem is you then have to expect your users to be able to do that. If you can at all, it's better to use xbmc's addon system
Reply
#6
It should be using the system python of the compiling computer. There may be a way to create a script.module to provide access through XBMC.

Reply
#7
Hi all,

I've succeeded including the module within my add-on, but at the cost of including the library on my folder, which yields in a 3.4MB add-on containing a cryptographic library that can only be used by my add-on.

Bstrdsmkr, you are experiencing the builtin version of the Python interpreter because you are using the pre-compiled versions of XBMC, so you are just downloading the whole executable prepared for your target machine. As giftie has said, XBMC is using the python interpreter used in the compiling machine, which is the difference between my Mac and my Linux host, as I am compile the XBMC running on my Linux machine, but I install the executable for my Mac.

Thanks everybody for your help Smile
Reply
#8
That makes much more sense lol. I wondered what the benefit of using the INSTALLING machine's python would be lol

Learn something new everyday

Like giftie was saying, If you just make it a script.module and mark that as a dependency in your addon, then other addons could use it. You'd just have to provide the script.module in your repo
Reply
#9
The script.module probably will need to be created at the time of compile, the same way that script.module.pil is created. This way it would be compiled based on the system. Probably best to see how script.module.pil is compiled and submit a pull request on GIT..
Reply

Logout Mark Read Team Forum Stats Members Help
Python interpreter0