在Python中导入qt的问题(problem with import qt in python)

编程入门 行业动态 更新时间:2024-10-28 08:28:58
在Python中导入qt的问题(problem with import qt in python)

我想用python来使用qt。 “import qt”return me:“ImportError:No module named qt”。 我已经安装pyqt。

我必须安装以激活“导入qt”

谢谢

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

最满意答案

目前的PyQt来自PyQt4包,它有几个模块。 你几乎总是需要从以下开始:

from PyQt4 import QtCore from PyQt4 import QtGui

如果您需要额外的PyQt子模块(如QtNetwork , QtSql等),则根据需要添加其他导入。


提示未来:找到Python安装的lib/site-packages库,并在安装后不确定名称时查看其中的软件包。

另外,用PyQt教程武装自己 - 任何体面的人都会在前几段中介绍这一点。

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.

更多推荐

本文发布于:2023-08-07 18:23:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1465484.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:qt   Python   problem   python   import

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!