grpc: grpcio or grpcio-tools does not anymore compile with Apple M1 chip on 1.40.1 but works on 1.40.0
What version of gRPC and what language are you using?
Both 1.40.1 and 1.40.0
What operating system (Linux, Windows,…) and version?
Apple maxOS Big Sur 11.6
What runtime / compiler are you using (e.g. python version or version of gcc)
Python 3.10.0rc2
What did you do?
When I compile protobuf with 1.40.1 I get error
File "/Users/user/.venv/lib/python3.10/site-packages/grpc/__init__.py", line 22, in <module>
from grpc import _compression
File "/Users/user/.venv/lib/python3.10/site-packages/grpc/_compression.py", line 15, in <module>
from grpc._cython import cygrpc
ImportError: dlopen(/Users/user/.venv/lib/python3.10/site-packages/grpc/_cython/cygrpc.cpython-310-darwin.so, 2): no suitable image found. Did find:
/Users/user/.venv/lib/python3.10/site-packages/grpc/_cython/cygrpc.cpython-310-darwin.so: mach-o, but wrong architecture
/Users/user/.venv/lib/python3.10/site-packages/grpc/_cython/cygrpc.cpython-310-darwin.so: mach-o, but wrong architecture
If I use 1.40.0, protobuf is compiled without errors
What did you expect to see?
I did expect to compile protobuf without errors.
What did you see instead?
Anything else we should know about your project / environment?
https://github.com/MarketSquare/robotframework-browser/tree/main/protobuf
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 11
- Comments: 16 (2 by maintainers)
At least for me
pip install --no-binary :all: grpcio --ignore-installed
provides workaround for the problem.pip install --no-binary :all: grpcio --ignore-installed
did not work for me. It kept throwing error regardingcygrpc.cpython-39-darwin.so
Installation via conda worked (on Python 3.9):
That did not work for me. I still get
this worked for me as well
Here cause i got the same error.
pip install --no-binary :all: grpcio --ignore-installed
worked for me, thanks @aaltat for providing the workaround!I faced the same issue while importing the “google-ads” package. It internally uses
cygrpc.cpython-310-darwin.so
pip install google-ads import -> from google.ads.googleads.client import GoogleAdsClient While building the project i see -
For reference -
grpcio version
python version - Python 3.10.0 I am using M1 chip macbook air.
Any workaround for this issue?
does anyone know similar command for poetry? (or better to say what parameters should I use)
Sorry about this. There seems to be an upstream change to 3.10 tool chain. https://github.com/grpc/grpc/issues/28387
For an immediate solution, Python 3.9 should free of this problem.