How to Solve Python TypeError: ‘module’ object is not callable

When I am used to writing java code, I will try to define package when I write Python code. However, when I introduce it, I report an error: typeerror: ‘module’ object is not called

Why

For example, I create the person. Py source file in the package, and then create the student class in this file

How to import the student class

Habitual thinking, from clazz. Student is OK, but it is not

The correct way is from clazz.person import student or from clazz.person import*

That is to say, which classes are imported from which py file under which package

Similar Posts: