[PyKDE] Problems building pyKDE 3.3.2 on RedHat 8.0
Jim Bublitz
jbublitz at nwinternet.com
Thu Feb 20 03:15:00 GMT 2003
On 20-Feb-03 Gary Cramblitt wrote:
> I am trying to build and install the following packages, but
> encountering problems.
> PyQt-x11-gpl-3.5.tar.gz
> sip-x11-gpl-3.5.tar.gz
> PyKDE-3.3.2-3.tar.gz
> My system is RedHat 8.0, Qt: 3.0.5, KDE: 3.0.3-8.3 Red Hat,
> Python: 2.2.1.
> Here is what I did. I unpacked each of the 3 packages above to
> /usr/local. I noted in the README files that environment
> variable KDEDIR is supposed to be defined. On my system, it is
> not. Hmmm, why not?
That seems to be a trend with distributions - SuSE no longer
defines it either.
> Worse, the following directory structure is expected
> $KDEDIR/lib
> $KDEDIR/include
> but apparently on my RH system, I have
> /usr/lib/kde3
> /usr/include/kde
> Notice how the directories are "inverted" from what is expected.
> I note on the web that most systems have KDEDIR pointing to
> /opt/kde, but my /opt directory is empty, so I do the following
> commands:
>
> mkdir /opt/kde
> ln -s /usr/lib /opt/kde/lib
> ln -s /usr/include/kde /opt/kde/include
> export KDEDIR=/opt/kde
Good solution. The KDEDIR export is only needed to build.
> I also note that README's say I should use -lqt-mt when building
> (because I have KDE 3). What is this?
There are two versions of the Qt lib - libqt is un-threaded and
libqt-mt is threaded. KDE 2.x.x (as normally compiled) will only
work with libqt, KDE 3.x.x will only work with libqt-mt. PyQt will
work with either lib, but PyKDE requires the the Qt lib that
matches the KDE version. If you use the wrong KDE/Qt combination,
everything will compile/link/install, but nothing will run.
> Anyway, I continue with the following commands (as su) with no
> apparent errors:
>
> cd /usr/local/PyQt-x11-gpl-3.5
> python build.py -lqt-mt -c
> make
> make install
> cd /usr/local/sip-x11-gpl-3.5
> python build.py -lqt-mt
> make
> make install
> cd /usr/local/PyKDE-3.3.2
> python build.py -lqt-mt -c
You should build sip first, then PyQt, and then PyKDE. If the
sequence above is what you actually did, you built PyQt with
the version of sip that comes with RH 8.0 (not likely 3.5), and then
built PyKDE with sip 3.5 but probably against the PyQt sip files
that came with RH 8.0 (also probably not 3.5). I don't believe that
a normal PyQt install will put any files in /usr/share/sip/qt/ - I'd
expect to find them in /usr/local/PyQt-x11-gpl-3.5/sip from the
above. (locate won't see them until updatedb is run again)
Just like the qt/qt-mt situation above, this stuff will often
compile and link with completely wrong sets of files, but then
won't work when you try to run something.
Try the following:
1. run sip -V -- you should see 3.5
2. In the Python interpreter, try 'import qt'; if that works, try
'import dcop' and 'import kdecore' (kdeui depends on all 3 of
those). I'm guessing none of those will work either.
3. Try some of the example programs from PyQt examples3/ directory.
If PyQt works (import qt and examples), there's some other problem
related to PyKDE. If PyQt doesn't work, you should be able to
rebuild PyQt (if the sip version reports correctly) and then
rebuild PyKDE with the correct path in the -v switch.
If the sip version doesn't report correctly, you'll need to
uninstall sip (using rpm -e) and then rebuild sip, PyQt and finally
PyKDE. Alternatively, you can find the version of sip you built
above and make sure it's earlier in PATH than the RH version, and
then rebuild PyQt and PyKDE.
> The last command says "can't find PyQt()/sip modules". I look in
> the build.py code and see that it is looking for qtmod.sip.
> Locate command reports "/usr/share/sip/qt/qtmod.sip", so I
> continue with the following commands (with no apparent errors):
> python build.py -lqt-mt -c -v/usr/share/sip/qt/qtmod.sip
> make
> make install
>
> When I try some of the examples, I get an error. For example:
>
> $python
> Python 2.2.1 (#1, Aug 30 2002, 12:15:30)
> [GCC 3.2 20020822 (Red Hat Linux Rawhide 3.2-4)] on linux2
> Type "help", "copyright", "credits" or "license" for more
> information.
>>>> import kdeui
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> File "/usr/lib/python2.2/site-packages/kdeui.py", line 73, in ?
> import libkdeuic
> ImportError: /usr/lib/python2.2/site-packages/libkdeuicmodule.so:
> undefined symbol: sipName_qt_del
> What did I do wrong? I am a newbie, so be gentle please. TIA
You seem to be doing fine - you've solved most of the problems
already. This is all pretty confusing at first (or in my case often
still is).
Jim
More information about the PyQt
mailing list