Import Error - building a well structured program

I think you need files to “register” a folder as a module. The Python help page you linked refers to this.

EDIT: Oh, you did this already. Have you tried making sure your case is correct? Python is case-sensitive, so Import Panditor may not work as your file name is

Not to be blunt, but the answer is in your original post where you said you understand the syntax is:

from folderName.moduleName import ClassName

In your case the folderName is panditor, the moduleName is panditor (the .py file) and the ClassName is Panditor so you should write:

from panditor.panditor import Panditor

or if you just write “import panditor” than you would access the class as “panditor.panditor.Panditor”

Make sense?

Have you tried importing just panditor, and then accessing the function via panditor.panditor.Panditor? Maybe you could try renaming some files to make it more logical and help with troubleshooting (i.e. panditor.main.Panditor).

It’s a circular import issue, as you can see from the traceback. imports, which imports, which tries to import again, resulting in an infinite loop. You have to restructure which module uses which other module.