Running into this issue in VS Code while trying to learn PyQt5, "No name 'QApplication' in module 'PyQt5.QtWidgets'", "No name 'QWidget' in module 'PyQt5.QtWidgets'"".
I'm not sure if this is a pylint issue or something else. I've confirmed PyQt5 is installed with pip3 list but I can't seem to figure out the issue.
import sys
from PyQt5.QtWidgets import QApplication, QWidget
def app():
my_app = QApplication(sys.argv)
w = QWidget()
w.setWindowTitle("Test")
w.show()
sys.exit(my_app.exec_())
app()
I'd expect this error to not keep displaying but its preventing me from running things in VS Code. Any help or suggestions appreciated.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…