検索
[Python] ImportError: Failed to import the Cloud Firestore library for Python.
- M.R

- 2021年10月19日
- 読了時間: 1分
現象
raspberry piでfirestoreをimportしようとするとタイトルのエラーが発生。
from from firebase_admin import firestoreImportError: Failed to import the Cloud Firestore library for Python. Make sure to install the "google-cloud-firestore" module."Make sure to install the "google-cloud-firestore" module."なんて言われているが、google-cloud-firestoreはちゃんと入っている。
pip3 list・・・
google-cloud-core 2.1.0
google-cloud-firestore 2.3.4
google-cloud-storage 1.42.3
・・・
原因と解決策
そこでimportの仕方を変えてみる。
from google.cloud import firestoreするとエラーメッセージが下記のように変わる。
importError: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.33' not found (required by /home/****/.local/lib/python3.7/site-packages/grpc/_cython/cygrpc.cpython-37m-arm-linux-gnueabihf.so)つまり、grpcioが要求するglibcのバージョンと実際のバージョンが異なるためエラーになっているらしい。
現在のgrpcioのバージョンは1.41.0なので、これを1.40.0にダウングレードしてみると、無事エラーが出なくなった。






コメント