TypeError: 'module' object is not callable

created at 07-11-2021 views: 2

This error means that the module is called as a function, but it cannot be called by itself.

The reason for the problem lies in the import mechanism.

There are two ways to import modules in Python: 

  1. import [module] 
  2. from module import [XXX]

The difference is that all imported things in the former need to be restricted by the module name when used, while the latter does not.

Use the following import method to try again, there is a high probability that the problem will be solved.

from module import *
Please log in to leave a comment.