基本的gRPC版本不起作用

时间:2018-07-01 13:31:07

标签: python grpc

我试图实现一个简单的gRPC服务器/客户端,并将问题缩小到甚至无法在我的计算机上运行的基本gRPC Python实现。

这是我尝试过的:

pip install grpcio grpcio-tools
git clone https://github.com/grpc/grpc.git
cd grpc/examples/python/route_guide
python run_codegen.py # Everything breaks whether I include this step or not
python route_guide_server.py

并出现以下错误:

-------------- GetFeature --------------
Traceback (most recent call last):
  File "route_guide_client.py", line 119, in <module>
    run()
  File "route_guide_client.py", line 109, in run
    guide_get_feature(stub)
  File "route_guide_client.py", line 48, in guide_get_feature
    latitude=409146138, longitude=-746188906))
  File "route_guide_client.py", line 34, in guide_get_one_feature
    feature = stub.GetFeature(point)
  File "/Users/p/anaconda/envs/py36/lib/python3.6/site-packages/grpc/_channel.py", line 514, in __call__
    return _end_unary_response_blocking(state, call, False, None)
  File "/Users/p/anaconda/envs/py36/lib/python3.6/site-packages/grpc/_channel.py", line 448, in _end_unary_response_blocking
    raise _Rendezvous(state, None, None, deadline)
grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with:
    status = StatusCode.UNIMPLEMENTED
    details = "Method not found!"
    debug_error_string = "{"created":"@1530451116.454542000","description":"Error received from peer","file":"src/core/lib/surface/call.cc","file_line":1083,"grpc_message":"Method not found!","grpc_status":12}"
>

如果有用,请在我的计算机配置上添加更多detail

1 个答案:

答案 0 :(得分:0)

意识到端口50051已被占用!