KDE+GNOME Bindings in SuSE 7.3

Jim jbublitzNO at SPAMnwinternet.com
Mon Apr 29 01:08:17 EDT 2002


Tom Chance wrote:
> I've just started out with Python, having been programming Perl for a 
> few years. I've been trying to get an app I downloaded a while ago 
> working without success until I found it couldn't import gnome.ui...

> I duly downloaded every RPM from the SuSE server I could find to do with 
> python, and tried again... no luck. I can't quite figure out what's 
> wrong. If I try "import gtk" or "import gnome" or "import kde" or 
> "import qt" I just get errors telling me I don't have modules by those 
> names.

> An rpm query for python gives the following results:

> tom at tigger:~> rpm -qa | grep py
> gnome-python-1.4.1-127
> pygnome-libglade-1.4.2-2
> python-tkinter-2.1.1-78
> pygtk-libglade-0.6.9-2
> pygnome-1.4.2-2
> python-tk-2.1.1-78
> python-gtk-1.4.1-83
> python-2.1.1-45
> pyxml-0.6.6-68
> python-nothreads-2.1.1-78

> So from that I would have thought it would work fine, but it doesn't. 
> I've also got the KDE bindings for KDE3.0 installed, and I can't seem to 
> get them either.

> I'm running SuSE 7.3 btw, if anyone else uses the same bindings on the 
> same distro...

> Any ideas? I'm at a dead end here...

First, the currently released PyKDE2 bindings only support KDE3.0beta2, 
or KDE2.x.x, not 3.0 final (that's about a week or two away)  If you've 
installed KDE3.0 final release on SuSE 7.3, you'll have to wait for a 
compatible set of PyKDE2 bindings.

I do PyKDE2 (the bindings for KDE), and I do them on SuSE7.1/7.3 
(depending on the version). Find your python directory (/usr/lib/python 
is normal for SuSE, although that should link to something like 
/usr/lib/python2.1). Next look for the site-packages subdirectory - if 
you have PyKDE2 installed, there should be a number of libk*cmodule.so 
entries there (somewhere between 9 and 11 different names), as well as 
some corresponding .py files.

Next, at the command line, open the Python interpreter and do:

 >>> import sys
 >>> print sys.path

You should see 'site-packages' included in the list that prints out.
(Ctrl-D to exit)

If that's all OK, go to the PyKDE2 directory, find the examples 
subdirectory, and try the example programs. They all have a .py 
extension, so to run them, enter 'python pykless.py' for example.

Things should be similar for PyGTK and some of the other programs you 
listed.

PS: The import statement(s) for KDE depends on which module(s) you want 
to use, for example:

from kdeui import KEdit
from kfile import KFileDialog
from kdecore import KAccel, KStdAccel, KCmdLineArgs

etc. The module names correspond to the KDE library names.You also need 
to have sip and PyQt installed, but I assume you do, since PyKDE2 won't 
build and install without them. Make sure, however, that they all match 
in version (latest is sip3.1, PyQt3.1, PyKDE2-3.1 - the 3.1 is the *sip* 
version *not* the KDE version).

Jim




More information about the Python-list mailing list