Python grpc-tools is declared to be missing right after I installed it
Asked Answered
T

4

5

I'm using the very latest Ubuntu 21.04 for aarch64. In order to experiment with gRPC, I installed grpc stuff:

python3 -m pip install grpc
python3 -m pip install grpcio-tools

I also tried:

pip3 install grpc
pip3 install grpcio-tools

These appeared to be successful however when I tried to generate my gRPC Python code from the .proto file, I was told by the system that grpcio-tools is not installed.

How to fix this? Is Ubuntu for aarch64 just broken?

Thunderstruck answered 5/8, 2021 at 18:40 Comment(0)
L
4

For me the problem was that I used python instead of python3 when executed the generation:

python3 -m grpc_tools.protoc --help
Lenity answered 17/9, 2021 at 10:37 Comment(0)
N
2

I don't have access to an ARM64 instance and so can't repro this.

According to Running gRPC and Protobuf on ARM64 (on Linux), it should be supported (with Python)

Please include in your question more details.

For me on Ubuntu 20.04 on an AMD64:

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:
...

And, I can run e.g. the hello-world Python sample

Nostalgia answered 6/8, 2021 at 16:10 Comment(1)
At it happens I was trying to run a modified version of their hello world example. You could try running this in Qemu if you want to reproduce it.Thunderstruck
G
0

It worked for me after closing both VSCode and Terminal, and starting them again.

Geochronology answered 3/10, 2021 at 11:11 Comment(1)
Did you do this on Ubuntu for aarch64? My computer is a raspberry pi 4.Thunderstruck
D
0

i had the same problem the solution is you install it using anaconda

Install grpc using conda

conda install -c conda-forge grpcio

conda install -c conda-forge grpcio-tools

it will work

Dana answered 11/11 at 11:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.