如何修复 ModuleNotFoundError: No module named 'google.cloud.iam'
问题:
你想运行一个使用 Google Cloud Python API 之一的 Python 脚本,但你收到此错误消息:
module_not_found_output.txt
ModuleNotFoundError: No module named 'google.cloud.iam'解决方案
使用 pip 重新安装任何 google cloud 包:
install_google_cloud.sh
pip install -U google-cloud-storage这也将重新安装相关的 google.cloud.iam 模块。
之后,重新运行你的脚本。如果不起作用,尝试 install --upgrade 其他 google-cloud-* 模块,特别是你实际在脚本中使用的模块。
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow