The Python NameError: name 'plt' is not defined occurs when we use the `pyplot` module without importing it first.