Skip to content

Tag: importerror

Struggling with python’s import mechanism

I am an experienced java enterprise developer but very new to python enterprise development shop. I am currently, struggling to understand why some imports work while others don’t. Some background: Our dev team recently upgraded python from 3.6 to 3.10.5 and following is our package structure Now, insid…

ImportError in test files

I’ve seen a lot of questions that are similar to this but none of the solutions have worked for me. I’m getting an import error when trying to run pytest on a test package I’m developing to teach myself how to create python packages. Currently I have a python package that looks like and my t…

“Most likely due to circular import” in Python

Does anyone know why this piece of code returns this error when run and how to fix it? When I run this code in normal IDLE it seems to work but it doesn’t work in Visual Studio Code. Answer It seems like the program file you have created is named threading.py, and you are importing a module also called …

ImportError while importing PySide2

I installed PySide2 using pip install PySide2 But i got this error when i tried to import it: Answer Have a look at the PyPI documentation here. If that doesn’t help try to use Make sure it is installede in your virtual environtment if you are using that and you are using the correct version of pip(3). …