AttributeError: module ‘firebase_admin.firestore’ has no attribute ‘AsyncClient’

I am using Firestore in my application and trying to use Python (Async) to run operations on Firestore.

I am using the example given in the official documentation here.
I am getting the below error while running db = firestore.AsyncClient().

root@54ec5947a266:/usr/src/app# python3 test.py 
Traceback (most recent call last):
  File "test.py", line 69, in <module>
    test()
  File "test.py", line 60, in test
    db = firestore.AsyncClient()
AttributeError: module 'firebase_admin.firestore' has no attribute 'AsyncClient'
root@54ec5947a266:/usr/src/app#

Looks like the AsyncClient is not found.

root@5e2f7f6fc19c:/usr/src/app# python3
Python 3.5.3 (default, Apr  5 2021, 09:00:41) 
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from firebase_admin import firestore
>>> 'AsyncClient' in dir(firestore)
False
>>> 

Could you please guide me if I am missing anything here.

Answer

AsyncClient does exist in python’s firestore submodoule:

>>> from firebase_admin import firestore
>>> 'AsyncClient' in dir(firestore)
True

Make sure you have installed python’s firease admin library correctly, and for your python and pip version and use firebase-admin installation guide.
(e.g. pip3 install –user firebase-admin)