Ask Your Question
4

I am attempting to import a class named "student" from test19test.py into test19(Inheritance).py, but I am getting an ImportError message stating that the import cannot be executed.

asked 2023-05-04 18:21:26 +0000

bukephalos gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-05-04 18:27:01 +0000

devzero gravatar image

There could be a few reasons why you are encountering an ImportError message when trying to import the "student" class from test19test.py into test19(Inheritance).py. Here are a few possible causes and solutions:

  1. The file test19test.py does not exist or is not in the same directory as test19(Inheritance).py. Make sure that the file is present and is located in the same directory as the file you are trying to import it into.

  2. The name of the file is incorrect or misspelled. Check that you are using the correct file name and that it is spelled correctly.

  3. The name of the class is incorrect or misspelled. Check that you are using the correct name of the class that you want to import.

  4. The student class is not defined in the test19test.py file. Check that there is a class defined in the file with the name "student".

  5. There are syntax errors in the test19test.py file that prevent it from being imported. Check for any syntax errors in the file that may be preventing it from being imported.

Once you have identified the problem, correct it and try importing the class again.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-05-04 18:21:26 +0000

Seen: 9 times

Last updated: May 04 '23