快速开始¶
https://grpc.io/docs/quickstart/python.html
安装gRPC¶
gRPC¶
python -m pip install grpcio
在 El Capitan OSX, 可能会报如下错误:
OSError: [Errno 1] Operation not permitted: '/tmp/pip-qwTLbI-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'
此时使用如下命令
python -m pip install grpcio --ignore-installed
安装gRPC工具¶
Python gRPC tools
包括 protocol buffer
编译器 protoc
和用于生成服务器和客户端代码的插件, generating server and client code
from .proto
service definitions. For the first part of our
quickstart example, we’ve already generated the server and client stubs
from
helloworld.proto,
but you’ll need the tools for the rest of our quickstart, as well as
later tutorials and your own projects.
安装 gRPC tools:
python -m pip install grpcio-tools