qt and python
Boudewijn Rempt
boud at rempt.xs4all.nl
Tue May 1 01:33:09 EDT 2001
Bob File <rfile at innet.com> wrote:
> Well, I've been loading new software and I seem to have broken PyQt
> I started out with SuSE 7.1
> After updating kde and QT to 2.1 and 2.3 respectively I get errors when
> I run any python file that imports qt as in:
> from qt import *
> When I try to run the file it tells me that Q(whatever) is not a
> variable. example:
> NameError: There is no variable named 'QApplication'
> When I use the path browser built into idle those classes seem to be
> there.
> In fact it seems to appear in 2 places in the path browser.
> There is a qt.py file in /usr/lib/python2.0 and
> /usr/lib/python2.0/site-packages
> So do I need a path fix or what? The latest PyQt won't compile on my
> system. The page I got PyQt 2.4 from said to install sip also and it
> compiled fine and put itself in /usr/local.
> PyQt gives me an error I cannot understand.
> In file included from qtcmodule.cpp:4099:
> sipqtProxyqt.moc:45: new declaration `static void
> sipProxyqt::staticMetaObject()'
> sipqtProxyqt.h:36: ambiguates old declaration `static class QMetaObject
> * sipProxyqt::staticMetaObject()'
> sipqtProxyqt.moc: In function `void
> __static_initialization_and_destruction_0(int, int)':
> sipqtProxyqt.moc:29: no matching function for call to
> `QMetaObjectInit::QMetaObjectInit (QMetaObject * (*)())'
> /usr/lib/qt-2.3.0/include/qmetaobject.h:259: candidates are:
> QMetaObjectInit::QMetaObjectInit(void (*)())
> /usr/lib/qt-2.3.0/include/qmetaobject.h:261:
> QMetaObjectInit::QMetaObjectInit(const QMetaObjectInit &)
> make[2]: *** [qtcmodule.lo] Error 1
What I'd do is carefully remove all traces of PyQt and sip from your
system. Start with SuSE's rpm's, then do a thorough search for bits
you might have added yourself. Then decide whether you want to build
PyQt with Python 2.0 or with Python 2.1 - the latter has some
advantages. If the base Python is good and free from PyQt, start with
sip 2.4 again and continue with PyQt 2.4
--
Boudewijn Rempt | http://www.valdyas.org | Christos Voskrese!
More information about the Python-list
mailing list