在编写脚本来下载YouTube视频时,我遇到了以下错误:
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>我已经在我的cmd和我的项目文件夹上安装了pytube和pytube3,但仍然收到这个错误。
那会是什么呢?我的代码非常非常简单,我不知道我哪里做错了。
from pytube import YouTube
url = 'https://www.youtube.com/watch?v=xO8hi9JEzNg'
YouTube(url).streams.first().download()发布于 2021-05-08 04:22:18
我也遇到了同样的问题,我通过安装GitHub库中的包解决了这个问题:
pip install git+https://github.com/nficano/pytubehttps://stackoverflow.com/questions/67441137
复制相似问题