0

I wanted to use pyqt6 with qtdesigner, I installed pyqt6 version 6.1 and it's tools (which include qtdesigner) and the installation was successful. After installation I opened qtdesigner and created an .ui file then later converted that .ui file in .py file in terminal. Then I tried to run the .py file but it shows some error like this :

Traceback (most recent call last):
  File "C:\Users\Aristo_NPC\PycharmProjects\PYQT\pyqt6\untitled.py", line 9, in <module>
    from PyQt6 import QtCore, QtGui, QtWidgets
ModuleNotFoundError: No module named 'PyQt6'
Press any key to continue . . .

How can I solve this issue? My python version is 3.9.9 thank you

I was expecting to open the same gui widgetthat I created on qtdesigner.

1 Answers1

0

To solve your problem, you can try uninstalling the pakage and then re-installing it again. Doing so often fixes the problem

To uninstall

pip uninstall PyQt6

To re-install

pip install PyQt6

If you don't have pip installed, which is very unlikely then you can install it with the following code

For linux

sudo apt install pip

For windows I believe you can run the following code to download or upgrade your pip.

python get-pip.py

You might need to specify the python version you are using.

If the problem is still there. Then it is quite possible that the problem is with the IDE you are using. Sometimes pakages don't work or show error when run is because of the virtual path of the IDE. It is possible that your IDE may not be installed in the same directory or folder as your python files or vice versa. I have had similar problems with pygame, numpy etc in VSC, so now i use Thonny to run my code.