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

运行Streamlit应用meditator时遇google.oauth2模块缺失错误

问题

克隆Streamlit项目https://github.com/theevann/meditator后运行报错:ModuleNotFoundError: No module named 'google.oauth2',回溯信息如下:

File "C:\ProgramData\anaconda3\envs\streamlitenv\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 552, in _run_script
exec(code, module.dict)
File "C:\Users\hibap\meditator\meditator.py", line 10, in
from voice_synthesis import synthesize_ssml, get_voice_list
File "C:\Users\hibap\meditator\voice_synthesis.py", line 2, in
from google.oauth2 import service_account

补充信息:已安装requirements.txt中的所有包,使用Anaconda虚拟环境,为编程新手。

解决步骤
  • 先激活你的Anaconda虚拟环境:打开Anaconda Prompt,输入conda activate streamlitenv,确认命令行前缀显示(streamlitenv)。
  • 安装缺失的依赖包:在激活的环境里运行pip install google-auth,google.oauth2是这个包的核心模块。
  • 验证安装成功:执行pip show google-auth,如果能看到包的版本、安装路径等信息,说明安装没问题,之后重新启动Streamlit应用即可。
  • 如果上述步骤无效,检查项目的requirements.txt里有没有google-auth,如果没有,手动把它添加进去,再运行pip install -r requirements.txt重新安装所有依赖。

内容的提问来源于stack exchange,提问作者Youssef El Rhazi

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.26 02:42:09