N00b can't import libraries!
#1
Smile 
Hi. I have an embarrassing problem. I'm sure it should be so easy, but I'm blatantly struggling to even get off the ground.

I have installed Python 3.2.2 and XBMC on a 64-bit Windows 7 laptop, and downladed Voinage's tutorial here.

I loaded up IDLE(Python GUI), open Default.py, hit F5, and none of the print commands with double quotes worked, so I commented them out.

Then I hit F5 again, and urllib2 couldn't be found, so I removed it.

Message was ImportError: No module named urllib2

Then I hit F5 again and xbmcplugin couldn't be found.

Same goes for xbmcgui

Can anyone tell me where I'm going wrong?
Reply
#2
vurtual Wrote:Hi. I have an embarrassing problem. I'm sure it should be so easy, but I'm blatantly struggling to even get off the ground.

I have installed Python 3.2.2 and XBMC on a 64-bit Windows 7 laptop, and downladed Voinage's tutorial here.

I loaded up IDLE(Python GUI), open Default.py, hit F5, and none of the print commands with double quotes worked, so I commented them out.

Then I hit F5 again, and urllib2 couldn't be found, so I removed it.

Message was ImportError: No module named urllib2

Then I hit F5 again and xbmcplugin couldn't be found.

Same goes for xbmcgui

Can anyone tell me where I'm going wrong?

The XBMC modules are not available to IDLE, or system Python(they are internal to XBMC)

Also, if you are developing for possible release to others, it would be best to use 2.6.6 or 2.7.2 as these are most common versions of the python accessible from XBMC. Version 3.2.2 has a lot of changes. For Example - http://docs.python.org/library/urllib2.html, you will notice that urllib2 has been split up.

I think most of us develop directly on XBMC.
Reply
#3
Thanks for that, but I'm still stupid, is there a Program Plugin for editting python code?
Reply
#4
You should be able to write python code is any editors you like. It's just that you will need to run it in XBMC if your code uses some XBMC depends.

Anyway, have you tried this? HOW-TOBig Grinebug_Python_Scripts_with_Eclipse

Might help.
Reply
#5
I'll try that, thanks.
Reply

Logout Mark Read Team Forum Stats Members Help
N00b can't import libraries!0