Exception: TypeError: 'module' object is not callable


  • A common mistake. Calling the class and not the method.


examples/numbers/rnd.py

import random

print("hello")
x = random()
print(x)
hello
Traceback (most recent call last):
  File "examples/numbers/rnd.py", line 3, in <module>
    x = random()
TypeError: 'module' object is not callable