TypeError: ‘module’ object is not callable
socket is a module, containing the class socket.
socket socket <module > socket.socket < > >>> socket socket socket < >
This is what the error message means:
module object is not callable, because your code is calling a module object. A module object is the type of thing you get when you import a module. What you were trying to do is to call a class object within the module object that happens to have the same name as the module that contains it. Here is a way to logically break down this sort of error: