Import Class Error <fixed>



I had this working, then I deleted the code and wrote it again and for some reason I get this error and I can’t import the class from another file.

I am new to Python and any help is very much appreciated, thank you.


at the top, try: import Student

@gustavo_alves: It looks like you have an indentation error in, which we can’t see right now (and we wouldn’t be able to see indentation in a screenshot anyway).

Using a code fence (``` around the code block, or just select it and use the </> button a the top of the post editor), paste the code from you’re trying to run. Screenshots are hard to debug.


I get the same error.

Is ‘Student’ also the name of a class in the file ‘Student’?

I guess it was a typing error that resulted in the indentation error. It’s fixed now, thank you!


Yes, it was. The problem was with the indentation, it’s fixed, thanks!

Reference material for this common error message:

1 Like