After upgrading to PySide6.3.0 getting error ModuleNotFoundError: No module named 'PySide6.QtWidgets'
source
import sys
from PySide6.QtWidgets import QApplication, QLabel
app = QApplication(sys.argv)
label = QLabel("Hello World!")
label.show()
app.exec()
error:
$ python3.10 test.py
Traceback (most recent call last):
File "test.py", line 2, in <module>
from PySide6.QtWidgets import QApplication, QLabel
ModuleNotFoundError: No module named 'PySide6.QtWidgets'
Seems like there are changes in PySide6.3.0
.
How to import QtWidgets
module in PySide6.3.0
?
Edit:
It is clear it is importing PySide6 package but its not importing packages like QtWidgets, QtGui, QtCore
#!/usr/bin/env python3.10
import sys
import PySide6
from PySide6 import QtWidgets
from PySide6.QtWidgets import (QApplication, QMainWindow, QWidget, QPushButton, QVBoxLayout, QHBoxLayout)
from PySide6 import QtCore
from PySide6.QtCore import (Qt, QSize)
if __name__ == "__main__":
app = QtWidgets.QApplication(sys.argv)
#TODO
app.exec()
output:
$ ./test.py
Traceback (most recent call last):
File "./test.py", line 4, in <module>
from PySide6 import QtWidgets
ImportError: cannot import name 'QtWidgets' from 'PySide6' (~/.local/lib/python3.10/site-packages/PySide6/__init__.py)