maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   ImportError: No module named mainloop.glib (https://talk.maemo.org/showthread.php?t=47591)

omeriko9 2010-03-17 10:56

ImportError: No module named mainloop.glib
 
I try to run the following python code:

PHP Code:

import gobjectdbus
from dbus
.mainloop.glib import DBusGMainLoop 

But I get the error in the title.


What am I doing wrong?
Any dependencies issue I might have?

lizardo 2010-03-17 14:42

Re: ImportError: No module named mainloop.glib
 
Are you running it on Scratchbox or on the device ?

Which product are you using (fremantle or diablo) ?

If running on scratchbox, make sure you are running "python2.5" instead of just "python"

Also make sure you have up-to-date python-gobject and python-dbus packages. To do so, make sure extras-devel is enabled, run "apt-get update", followed by "apt-get install python-gobject python-dbus"

I tried the lines above on Scratchbox (fremantle) and they worked just fine.

omeriko9 2010-03-17 16:18

Re: ImportError: No module named mainloop.glib
 
Thank you for your reply.
I'm using fremantle on the N900 itself.

When I apt-get both packages you mentioned, I get
"x is already the newest version".

Also, I get the same error when running "pythone2.5 filename.py" and "python filename.py".

So, the issue still exist...

omeriko9 2010-03-17 18:04

Re: ImportError: No module named mainloop.glib
 
Ok, I've found the source of this error, for whoever is interested...

It was caused by my lack of python knowledge.
I called the script dbus.py, which caused the line "from gobject, dbus" to reference the same file I was trying to run...

good to know :)


All times are GMT. The time now is 20:11.

vBulletin® Version 3.8.8