maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Troubles with python and gconf (https://talk.maemo.org/showthread.php?t=27452)

dwforslund 2009-03-11 23:44

Troubles with python and gconf
 
I'm having trouble with a few python applications that apparently use gconf. If I run "python"
and then type from gnome import gconf
I get ImportError: cannot import gconf.

This is the same error I get from a few applications that use python. Gconf is there when I check with dpkg, but something isn't configured right. Any suggestions?

qwerty12 2009-03-12 08:05

Re: Troubles with python and gconf
 
If you're doing this from scratchbox, make sure to use python2.5 (or set SBOX_REDIRECT_IGNORE). Running "python" invokes scratchbox's internal version which isn't really meant to be used by much else except for scratchbox.

michaelnt 2009-03-12 08:06

Re: Troubles with python and gconf
 
On Maemo you've to run

import gnome.gconf

pycage 2009-03-12 08:32

Re: Troubles with python and gconf
 
Some installations of pymaemo are broken, and the gconf module cannot be imported at all.
For these cases I've written a simple workaround gconf module replacement using gconftool-2, which can be used if "import gnome.gconf" fails:

Code:

try:
    import gnome.gconf as gconf
except:
    import gconftool as gconf

It's not feature-complete, though, but good enough for basic tasks.

https://garage.maemo.org/plugins/scm...ox&view=markup

dwforslund 2009-03-12 23:42

Re: Troubles with python and gconf
 
I think that my python2.5 environment is missing some things now for some unknown reason. Is there any way to fix this environment without reflashing the system with the latest OS? I'm seeing python2.5-gtk2 as missing for example when I want to upgrade or install some software.

pycage 2009-03-13 06:48

Re: Troubles with python and gconf
 
You should install python2.5-runtime. This metapackage will install the most common Python modules (including python-gtk).

dwforslund 2009-03-14 04:00

Re: Troubles with python and gconf
 
I tried doing an apt-get install python2.5-runtime and nothing was installed as it thinks I have the newest version. Can I uninstall it and reinstall it safely? It looks like if I remove, it will remove a bunch of programs in addition, all of which will have to be reinstalled. Removing python2.5-runtime would cause these to be removed too: "easy mcalendar, mediabox mediabox-internet-radio mediabox-worldtv mnotes python-dateutil quicknote rapier and usbcontrol" in addition to python2.5-runtime. I assume then that I would have to reinstall all of these programs after reinstalling python2.5-runtime

pycage 2009-03-14 10:57

Re: Troubles with python and gconf
 
If all those applications you mention are working, then you definitely have python2.5-gtk2 installed.

dwforslund 2009-03-14 14:10

Re: Troubles with python and gconf
 
Some of them including rapier are not working. Some do.

dwforslund 2009-03-14 15:13

Re: Troubles with python and gconf
 
I uninstalled python2.5-runtime and it uninstalled the above mentioned apps. I then installed python2.5-runtime and the apps, but rapier still fails on a gconf import. Labyrinth is another application that fails on gconf import in the same way as rapier. I can only conclude that uninstalling python2.5-runtime and reinstalling did nothing to deal with the problem I'm having.


All times are GMT. The time now is 16:30.

vBulletin® Version 3.8.8