python - 基本 gRPC 版本不工作

标签 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如果有用的话,在我的机器配置上。

最佳答案

意识到50051端口被占用了!

关于python - 基本 gRPC 版本不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51123737/

相关文章:

python - threading.Thread 如何在 Python 中产生剩余的量子?

python - 如何从 protobuf 生成 python 类文件

c# - 如何在 C# 中为 protobuf map<string, string> 属性设置值

go - 由 grpc proto3 生成的 protobuff 中的蛇形格样式

python - tkinter:打开一个带有按钮提示的新窗口

python - 你如何找到 conn = psycopg2.connect(dbname=, user=, password=, host = ) 的参数

python - 是否可以内联使用 with 语句?

python - Pandas 系列的小时值到系列的日期

.net - Dapr .Net SDK InvokeMethodGrpcAsync() gRPC 调用问题

java - grpc protobuf java 中的 NoSuchMethodException 和 NoClassDefFoundError