1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Raspberry PiでgRPCが動かない

Last updated at Posted at 2022-03-19

Raspbian GNU/Linux 11 (bullseye)にてgRPCを使ったPythonプログラムを実行しようとしたら次のエラーが出た。

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/etcd3/init.py", line 3, in <module>
    import etcd3.etcdrpc as etcdrpc
  File "/usr/local/lib/python3.9/dist-packages/etcd3/etcdrpc/init.py", line 2, in <module>
    from .rpc_pb2_grpc import *
  File "/usr/local/lib/python3.9/dist-packages/etcd3/etcdrpc/rpc_pb2_grpc.py", line 2, in <module>
    import grpc
  File "/usr/local/lib/python3.9/dist-packages/grpc/init.py", line 22, in <module>
    from grpc import _compression
  File "/usr/local/lib/python3.9/dist-packages/grpc/_compression.py", line 15, in <module>
    from grpc._cython import cygrpc
ImportError: /usr/local/lib/python3.9/dist-packages/grpc/_cython/cygrpc.cpython-39-arm-linux-gnueabihf.so: undefined symbol: __atomic_exchange_8

pipでインストールされるgRPCライブラリに問題があるようなので、代わりにapt経由でインストールすれば解決した。 

$ pip uninstall -y grpcio grpcio-tools
$ sudo apt install -y python3-grpcio python3-grpc-tools

参考

1
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?