You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

已安装pytube但导入时提示“ModuleNotFoundError: No module named 'pytube'”的问题求助

已安装pytube但导入时提示“ModuleNotFoundError: No module named 'pytube'”的问题求助

大家好,我最近碰到了一个搞不懂的问题,想请各位帮忙支个招:

我目前用的是Python 3.13.2,需要用到pytube 15.0.0。但是当我运行包含from pytube import YouTube的程序时,直接报了模块找不到的错误,具体的报错信息如下:

will.air@Mac python % python3 main.py ../test_text_files/tests.txt
Traceback (most recent call last):
File "/Users/will.air/YouTube_Downloader/python/main.py", line 3, in         
<module>
from stats.py import download, downloadMulti, audioOnly, audioMulti,         
getTotalRuntime
File "/Users/will.air/YouTube_Downloader/python/stats.py", line 1, 
in <module>
from pytube import YouTube
ModuleNotFoundError: No module named 'pytube'
will.air@Mac python % pipx install pytube
'pytube' already seems to be installed. Not modifying existing 
installation in '/Users/will.air/.local/pipx/venvs/pytube'. Pass
'--force' to force installation.

我已经确认pytube是安装好了的,而且也检查过Python的PATH路径,确保它在里面,但就是没办法正常导入,实在不知道哪里出问题了,有没有朋友遇到过类似的情况,或者能给我一些排查的方向呀?

备注:内容来源于stack exchange,提问作者Will

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.13 19:13:10