【发布时间】:2016-09-26 23:20:50
【问题描述】:
我现在正在学习 PyQt5
当我尝试运行以下代码时
from PyQt5.QtWidgets import QApplication
我犯了错误
Traceback (most recent call last):
File "<ipython-input-10-0ebe4054b7ae>", line 1, in <module>
from PyQt5.QtWidgets import QApplication
RuntimeError: the PyQt5.QtCore and PyQt4.QtCore modules both wrap the QObject class
那怎么了?谢谢帮忙!
【问题讨论】:
-
parts of both PyQt4 and PyQt5 are being imported at some point。您应该能够在两行中重现相同的错误:
from PyQt4.QtCore import QObject和from PyQt5.QtCore import QObject。 -
我用另一台笔记本电脑运行我以前的代码,但没有遇到错误