First Steps in Qt Creator: ModuleNotFoundError: No module named 'PyQt5' - beginners issue
Unsolved
Qt for Python
-
Hi there,
I am new to Qt. I downloaded and installed Qt from the website. I developed my application in Python, through Spyder IDE. Now i want to make the interface using Qt creator.
Situation:
- Installed Qt.
- Run the most basic example available online (https://doc.qt.io/qtforpython/tutorials/qmlapp/qmlapplication.html)
- Receive the following error: ModuleNotFoundError: No module named 'PyQt5'
More info:
- Pip list: PyQt5 5.12 is installed. (no virtual environment in place)
- Installed folder of PyQt5: "C:\Users{user}\AppData\Roaming\Python\Python38\site-packages\PyQt5\QtGui.pyd"
- When running Qt: Kit: Desktop
- Evaded PyQt5, used a different example with PySide6: similar issue: "ModuleNotFoundError: No module named 'PySide6'.
Further:
- I checked Qt application to see if I may force the application to look at the PyQt5 folder for the module: I could not find a way to force Qt.
- I checked QML2_IMPORT_PATH: but found no correct explanation on how to actually implement it..
What did I miss when Installing Qt?
How to solve this issue?Thank you, Kind regards,
Ivo
-
Thank you for your reply. I tried several solutions compared to last week.
- Identified two python versions. So I created a new virtual environment.
- I stopped with PyQt5 as I could not find an installation that seemed to work.
- I installed and uninstalled python and PySide2: untill PySide worked on my IDE (Spyder), in versions: PySide2 5.13.2 and Python 3.6.13.
- Set QT to look at the new virtual environment python.exe
- In QT i was however still unable to run a simple example: I received DLL errors. Also, on the Spyder (IDE), when trying to view a qml example, there were no warnings, but also no pop-up. PySide2 without qml works however.
Any tips?
Thank you.
Kind regards,
Ivo