简体   繁体   English

使用PyCharm导入PyQt4.QtGui但不导入QtCore

[英]Importing PyQt4.QtGui but not QtCore with PyCharm

My problem is that I can perfectly, in the ubuntu's terminal, type : 我的问题是我可以在ubuntu的终端中输入:

from PyQt4 import QtCore, QtGui 从PyQt4导入QtCore,QtGui

There are no errors.I think it means that python3.4 has all the modules I want. 没有错误,我认为这意味着python3.4具有我想要的所有模块。
However, when I type those lines in PyCharm (with the 3.4python interpreter) it tells me : QtGui is an unsolved reference . 但是,当我在PyCharm中(使用3.4python解释器)键入这些行时,它会告诉我: QtGui is an unsolved reference

It drives me crazy. 它让我疯狂。 Any ideas about the problem ? 关于这个问题有什么想法吗? Thanks a lot. 非常感谢。

A workaround I used to prevent this was: 我用来防止这种情况的解决方法是:

import PyQt4.QtGui as QtGui
import PyQt4.QtCore as QtCore

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM