开发者

problem with import qt in python

开发者 https://www.devze.com 2023-02-28 02:28 出处:网络
I want to use qt with python. \"import qt\" return me :\"ImportError: No module named qt\". I already instaled pyqt.

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


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.


import PyQt4 works for me fine.

0

精彩评论

暂无评论...
验证码 换一张
取 消