[vtkusers] VTK, Python, and Qt4

Doug Hackworth doug.hackworth at vanderbilt.edu
Fri May 2 14:31:19 EDT 2008


Prabhu Ramachandran wrote:
>> "RuntimeError: the PyQt4.QtCore and qt modules both wrap the QObject 
>> class"
>>
>> Here is what I'm importing:
>>
>> import sys
>> import vtk
>> import qt
>> from vtk.qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor
> 
> I am no Qt expert but IIRC qt4 is not to be used with Qt (which is why 
> you have a separate qt4 package).  You have to use qt4 in its entirety 
> instead of the older qt3.

Many thanks again, Prabhu, that's exactly what the problem was.  I had not 
realized that 'import qt' was actually importing qt3 (its Ubuntu package had 
been installed as a dependency for something else, which had escaped my notice) 
and that the entirely different statement 'import PyQt4' is needed to import 
qt4.  A non-obvious point (at least to me) and why I appealed to you experts in 
the first place.  Thanks!




More information about the vtkusers mailing list