Can't import PyQt5

So I’m absolutely new to PyQt5 and apologize ahead.
Currently I’m trying to get this thing to work and now spent a good 5 hours or so trying to figure it out but I just can’t. I pip installed PyQt5 systemwide but as soon as I try to run import the library I get an ImportError in the first line and a ModuleNotFoundError in the second.enter image description here

Furthermore if I try to install PyQt5-tools everything goes absolutely nuts and I just can’t figure out what is going wrong where and it’s driving me insane.
enter image description here

Here are all the packages I have installed.
enter image description here

>Solution :

You need to name your own file something other than PyQt5.py. Python will first try to import things from the folder that you are currently in, so it will find your script PyQt5.py, which tells it to import PyQt5.py, which tells it to import… and so on. This is the reason that you get the hint "most likely due to a circular import".

Leave a Reply