How to Solve NameError: name 'YouTube' is not defined -- pytube

Solution: Import the 'YouTube' module

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

from pytube import YouTube

 

For more information:
Python pytube YouTube