Apr-16-2022, 04:50 PM
Hi I'm now using pyCharm, and it looks great. It can't find my module pyside6. Here's the problem :
import sys import random from PySide6 import QtCore, QtWidgets, QtGui class MyWidget(QtWidgets.QWidget): def __init__(self): super().__init__() self.hello = ["Hallo Welt", "Hei maailma", "Hola Mundo", "Привет мир"] self.button = QtWidgets.QPushButton("Click me!") self.text = QtWidgets.QLabel("Hello World", alignment=QtCore.Qt.AlignCenter) self.layout = QtWidgets.QVBoxLayout(self) self.layout.addWidget(self.text) self.layout.addWidget(self.button) self.button.clicked.connect(self.magic) @QtCore.Slot() def magic(self): self.text.setText(random.choice(self.hello)) if __name__ == "__main__": app = QtWidgets.QApplication([]) widget = MyWidget() widget.resize(800, 600) widget.show() sys.exit(app.exec())Produces the following error :
Error:C:\Users\GreenBus\PycharmProjects\vapeomatic\venv\Scripts\python.exe C:/Users/GreenBus/PycharmProjects/vapeomatic/main.py
Traceback (most recent call last):
File "C:\Users\GreenBus\PycharmProjects\vapeomatic\main.py", line 3, in <module>
from PySide6 import QtCore, QtWidgets, QtGui
ModuleNotFoundError: No module named 'PySide6'
Process finished with exit code 1