简体   繁体   中英

Failed to import the Cloud Firestore library for Python: App Engine, python 3.9

I'm trying to build a website on Google App Engine Standard Environment with Flask. Python 3.9.

I'm also using Firestore(Native Mode):

import firebase_admin
from firebase_admin import credentials
from firebase_admin import firestore
cred = credentials.Certificate("*****.json")
firebase_admin.initialize_app(cred)
db = firestore.client()

Locally everything works fine, but after deploying I get the following errors:

  1. ImportError: Failed to import the Cloud Firestore library for Python. Make sure to install the "google-cloud-firestore" module.
  2. ImportError: cannot import name 'cygrpc' from 'grpc._cython' (/workspace/venv/lib/python3.9/site-packages/grpc/_cython/ init .py)

I installed grpcio , google-cloud-core , google-cloud-firestore , but still have this problem.

该错误给人的印象是 google-cloud-firestore 不在您的 requirements.txt 文件中,因此在您在生产环境中运行应用程序时未安装。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM