I have to install GRPC python from source as the target machine does not have internet connection. The target machine has python 3.7 and pip3 installed. Can anyone share the process how to do it. Thanks in advance
-
I guest grpc has a lot of dependencies that need to be downloaded from internet. But your machine does not have internet, with grpc source code only you can not finish the installation, unless all the dependencies are available on your local machine. – user675693 Sep 29 '21 at 17:23
-
A similar discussion at https://stackoverflow.com/questions/69358280/using-grpc-python-without-internet-access-and-pip-install-for-custom-linux-distr – user675693 Sep 29 '21 at 17:46
2 Answers
You can try to package the gRPC Python as a binary wheel and send it to the target machine. In your scenario, if you haven't changed the gRPC source code and just want to install gRPC on a no-internet machine, I would recommend to download the binary wheel: https://pypi.org/project/grpcio/#files
You may also need to upgrade your pip version to install from latest-standard of binary wheel. If your distribution is SELINUX 32bit, I guess following wheel might work: manylinux_2_17_i686.manylinux2014_i686.whl

- 1,801
- 8
- 13
Here's how I solved the problem. The main issue with using the downloaded gRPC package is that the cython compiler is platform dependent. The cython compiler is found in the grpc/_cython and it looks something like this "cygrpc.cp37-win_amd64.pyd". Here cp37 is the python version, win is the os or the platform name and amd64 is the architecture.
What I did in order to solve this issue, is I had to download the corresponding cython file for 32bit Linux platform - cygrpc.cpython-37m-i386-linux-gnu.so . I then created 2 separate grpc packages - one for Linux and one for Windows. This can be extended to as many platforms and architectures you want.
After this using pf = platform.system()
to determine the os and architecture and called the respective grpc package.
This comprehensively solved the issue for me.

- 11
- 3