Reputation: 181
Writing a script to download a YouTube video I face the following error:
Traceback (most recent call last):
File "c:\Users\migue\Desktop\PythonScripts\main.py", line 1, in <module>
from pytube import YouTube
ModuleNotFoundError: No module named 'pytube'
PS C:\Users\migue\Desktop\PythonScripts>
I already installed pytube and pytube3 on my cmd and on my project folder but I still get the error.
What could it be? My code is very very simple and I don't know how I did wrong.
from pytube import YouTube
url = 'https://www.youtube.com/watch?v=xO8hi9JEzNg'
YouTube(url).streams.first().download()
Upvotes: 1
Views: 6217
Reputation: 556
I had the same problem, which I solved by installing the package from its GitHub repo:
pip install git+https://github.com/nficano/pytube
Upvotes: 2