如何修复 Python 中的 ModuleNotFoundError: No module named 'grpc'
问题:
你想运行一个使用某些 Google Cloud 服务的 Python 脚本。但是你看到类似这样的错误消息:
grpc_module_not_found.txt
[...]
File "/usr/local/lib/python3.6/dist-packages/google/api_core/gapic_v1/__init__.py", line 16, in <module>
from google.api_core.gapic_v1 import config
File "/usr/local/lib/python3.6/dist-packages/google/api_core/gapic_v1/config.py", line 23, in <module>
import grpc
ModuleNotFoundError: No module named 'grpc'解决方案
安装 grpcio Python 模块:
install_grpc.sh
pip install -U grpcioIf this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow