How to Solve NameError: name 'pyspark' is not defined

Solution: Import the 'pyspark' module

To Solve the error, add the following line to the top of your code.

import pyspark

 

For more information:
Python pyspark