【发布时间】:2017-01-18 21:25:53
【问题描述】:
我是 VS Code 的新手,我安装了例如PySide 用于我用 Python 编写的教程项目。我尝试:
from PySide.QtGui import QDialog, QApplication, QVBoxLayout, QLineEdit, QTextBrowser
from PySide.QtCore import *
虽然代码使用导入的模块运行良好,但 VS Code 抱怨:
[pylint] E0401:Unable to import 'PySide.QtGui'
或
[pylint] E0401:Unable to import 'PySide.QtCore'
这很烦人,因为我可以按预期使用这些模块。我猜是配置问题,但不知道如何解决。
非常感谢。
另见:
Visual representation of VS Code complaining
编辑:
我使用 PySide 的预编译版本。这可能是这种行为的原因吗?
【问题讨论】:
-
您是否偶然使用了 virtualenv? (虚拟环境)?
-
没有。我不知道。
标签: python qt pyside visual-studio-code