Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>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".

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading