Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
So lost
#7
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....
Reply


Messages In This Thread
So lost - by mtndewwarrior - Sep-23-2018, 12:22 AM
RE: So lost - by Larz60+ - Sep-23-2018, 01:05 AM
RE: So lost - by mtndewwarrior - Sep-23-2018, 02:47 AM
RE: So lost - by Axel_Erfurt - Sep-23-2018, 09:58 AM
RE: So lost - by mtndewwarrior - Sep-23-2018, 03:23 PM
RE: So lost - by Axel_Erfurt - Sep-23-2018, 03:30 PM
RE: So lost - by mtndewwarrior - Sep-23-2018, 03:33 PM
RE: So lost - by Axel_Erfurt - Sep-23-2018, 04:00 PM
RE: So lost - by mtndewwarrior - Sep-23-2018, 04:00 PM
RE: So lost - by Axel_Erfurt - Sep-23-2018, 04:13 PM
RE: So lost - by mtndewwarrior - Sep-23-2018, 04:21 PM
RE: So lost - by Axel_Erfurt - Sep-23-2018, 07:42 PM
RE: So lost - by snippsat - Sep-23-2018, 08:49 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020