[PyKDE] PyQt - undefined symbol

Jim Bublitz jbublitz at nwinternet.com
Sat Apr 19 18:31:00 BST 2003


On 19-Apr-03 Phil Thompson wrote:
> On Saturday 19 April 2003 2:42 am, Erik Dahlgren wrote:
>> I am trying to install PyKDE 3.5-2 but I am having some
>> problems. When running the build.py script  I get

>> Error: Couldn't import qt module from PyQt -- from line 725 in
>> build.py

>> When trying to import qt  in python I get

>> ImportError: /usr/lib/python2.2/site-packages/libqtcmodule.so:
>> undefined symbol: PyUnicodeUCS2_FromUnicode

>> I didn't have any problems when installing PyQt (at least I
>> don't think so). My system is RH8 mostly updated to RH9 with
>> qt and kde compiled from Red Hat source rpms.  I have qt
>> 3.1.2-0.8x.1 and kde 3.1.1-0.8x.1

>> Any help would be appreciated!
 
> To quote the Python source (Include/unicodeobject.h):
> 
> /* Unicode API names are mangled to assure that UCS-2 and UCS-4
> builds produce different external names and thus cause import
> errors in case Python interpreters and extensions with mixed
> compiled in Unicode width assumptions are combined. */
 
> In other words your Python interpreter has been built with
> Py_UNICODE_WIDE defined, but PyQt has been built without it
> defined. As PyQt picks the definition up from your Python
> installation automatically (by #including Python.h), it implies
> that your Python installation is inconsistent.

Yes - I had him check libqtcmodule.so, and libpython.a, but forgot
about the python executable itself. He should run the same nm test
on /usr/bin/python, because that's probably where the mismatch is
(I sure hope so anyway). The two libs both show a 'U' for the
symbol, which is defined in the executable, not the lib.

Since he has RH8 and updated some stuff from RH9, it's likely that
there's a Python-devel RPM that also needs to be updated to RH9, or
whatever RPM contains Python.h and libpython.a. If he also has the
RH9 Python-devel package installed and gets the same error, then it
might be best to delete Python, d/l a new version (but not 2.3) from
python org, and rebuild Python, sip and PyQt from scratch.

Jim




More information about the PyQt mailing list