pyqt import problem

7.6k views Asked by At

I am having some trouble doing this in Python:

from PyQt4 import QtCore, QtGui
from dcopext import DCOPClient, DCOPApp

The traceback I get is

from dcopext import DCOPClient, DCOPApp 
File "/usr/lib/python2.5/site-packages/dcopext.py", line 35, in <module>
from dcop    import DCOPClient
RuntimeError: the qt and PyQt4.QtCore modules both wrap the QObject class

I tried switching the imports, importing dcopext later in the file, but none worked. Thanks for any suggestions.

Edit: I have narrowed it down to one problem: I am using dcopext which internally uses qt3, but I want it to use PyQt4.

1

There are 1 answers

1
dF. On

The dcopext module is part of PyKDE3, the Python bindings for KDE3 which uses Qt 3.x, while you're using PyQt/Qt 4.x.

You need to upgrade to PyKDE4, now released as part of KDE itself, unless you want to target KDE 3 in which case you need a corresponding old version of Qt and PyQt (3.x).