Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

problem with import qt in python

Tags:

python

I want to use qt with python. "import qt" return me :"ImportError: No module named qt". I already instaled pyqt.

what I hve to install in order to activate "import qt"

Thank You

like image 821
dmdorf Avatar asked Apr 23 '11 19:04

dmdorf


2 Answers

The current PyQt comes in the PyQt4 package, which has several modules. You almost always need to start with:

from PyQt4 import QtCore
from PyQt4 import QtGui

Add other imports as necessary if you need additional sub-modules of PyQt (like QtNetwork, QtSql etc).


Tip for the future: find the lib/site-packages library of your Python installation and look at the packages in there if you're not sure about the name after installing.

Also, arm yourself with a PyQt tutorial - any decent one covers this in the first few paragraphs.

like image 165
Eli Bendersky Avatar answered Oct 12 '22 02:10

Eli Bendersky


import PyQt4 works for me fine.

like image 32
ulidtko Avatar answered Oct 12 '22 02:10

ulidtko