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

Solution: Import the 'nltk' module

# Add the following line to the top of your code
import nltk

 

For more information:
Python nltk