& Ldquo; TypeError: The 'module' object is not callable & rdquo; Trying to use pprint


I've tried this code to pretty print a dict:

import pprint


This throws the following error:

Traceback (most recent call last):
  File "temp.py", line 3, in <module>
TypeError: 'module' object is not callable

Why is it not callable?

Try importing using:

from pprint import pprint

The pprint() function is in the pprint module.