Sep-23-2018, 03:33 PM
(This post was last modified: Sep-23-2018, 03:51 PM by mtndewwarrior.)
import sys print(sys.version) from PyQt5.QtWidgets import (QApplication, QMainWindow, QMessageBox) class MainWindow(QMainWindow): def __init__(self): super(MainWindow, self).__init__() self.setWindowTitle("Test") self.setGeometry(50, 50, 250, 150) def msgbox(self, message): QMessageBox.information(self, "Message", message) if __name__ == '__main__': import sys app = QApplication(sys.argv) mainWin = MainWindow() mainWin.show() mainWin.msgbox("it works") sys.exit(app.exec_())I have it printing the python version. as far as i can tell i am using python 3
C:\Users\mjona\PycharmProjects\untitled\venv\Scripts\python.exe "C:/Users/mjona/PycharmProjects/untitled/test projects/gui test.py"
Traceback (most recent call last):
3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)]
File "C:/Users/mjona/PycharmProjects/untitled/test projects/gui test.py", line 5, in <module>
from PyQt5.QtWidgets import (QApplication, QMainWindow, QMessageBox)
ModuleNotFoundError: No module named 'PyQt5'
Process finished with exit code 1
PyQt5 is probably installed into site-packages and not dist-packages.
You must verify your PYTHONPATH, and add site-package if needed.
export PYTHONPATH=$PYTHONPATH:/usr/lib/python3.2/site-packages (adapt
the path)
this is the only thing i have found that could actually be my problem, but i have tried what is says to do, and i cant figure it out. i copied the code, and put the location of site packages on my pc....