我使用的是最新的aarch64版Ubuntu21.04。为了试验gRPC,我安装了grpc的东西:
python3 -m pip install grpc
python3 -m pip install grpcio-tools
我也试过了:
pip3 install grpc
pip3 install grpcio-tools
但是,当我尝试从.proto文件生成grpcio- gRPC代码时,系统告诉我没有安装grpcio-tools。
如何解决这个问题?aarch64版的Ubuntu是不是坏了?
发布于 2021-09-17 10:37:26
对我来说,问题是我在执行生成时使用了python而不是python3:
python3 -m grpc_tools.protoc --help
发布于 2021-08-06 16:10:40
我不能访问ARM64实例,所以不能重现它。
根据Running gRPC and Protobuf on ARM64 (on Linux)的说法,应该支持它(使用Python)
请在您的问题中包含更多详细信息。
对于我在AMD64上的Ubuntu20.04:
python -m grpc_tools.protoc --help
/usr/bin/python: No module named grpc_tools
python -m venv venv
source venv/bin/activate
python3 -m pip install grpcio grpcio-tools
Collecting grpcio
Using cached grpcio-1.39.0-cp38-cp38-manylinux2014_x86_64.whl (4.3 MB)
Collecting grpcio-tools
Using cached grpcio_tools-1.39.0-cp38-cp38-manylinux2014_x86_64.whl (2.5 MB)
Collecting six>=1.5.2
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Requirement already satisfied: setuptools in ./venv/lib/python3.8/site-packages (from grpcio-tools) (44.0.0)
Collecting protobuf<4.0dev,>=3.5.0.post1
Using cached protobuf-3.17.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.0 MB)
Installing collected packages: six, grpcio, protobuf, grpcio-tools
Successfully installed grpcio-1.39.0 grpcio-tools-1.39.0 protobuf-3.17.3 six-1.16.0
python -m grpc_tools.protoc --help
Usage: /${HOME}/venv/lib/python3.8/site-packages/grpc_tools/protoc.py [OPTION] PROTO_FILES
Parse PROTO_FILES and generate output based on the options given:
...
例如,我可以运行hello-world
Python sample
发布于 2021-10-03 11:11:14
在关闭VSCode和终端并重新启动它们后,它对我起作用了。
https://stackoverflow.com/questions/68671940
复制相似问题