作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
from __future__ import unicode_literals
import youtube_dl
print('Hello, please insert the url of the video that you want to download.')
downloadUrl = input()
ydl_opts = {}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.download([downloadUrl])
嘿,嗯,当用 cmd 打开时,程序总体上似乎工作得很好,但是当我尝试在 IDLE 中使用 F5 运行它时,它崩溃并出现错误:ImportError:没有名为 youtube_dl 的模块。我已经安装了它并尝试重新安装它。这个特定的程序工作正常,但尝试使用此模块编写其他任何内容时,即使在 cmd 窗口中也会出现此错误。
最佳答案
使用以下 pip 命令重新安装它对我有用。
CMD:pip install --upgrade youtube-dl
Jupyter Notebook:!pip install --upgrade youtube-dl
关于python - 导入错误: No module named youtube_dl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44348032/
我是一名优秀的程序员,十分优秀!