Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No module named azure.cosmos.cosmos_client

I'm getting the next error while running the example python script of azure cosmos db:

Traceback (most recent call last):
  File "CosmosGetStarted.py", line 1, in <module>
    import azure.cosmos.cosmos_client as cosmos_client
ImportError: No module named azure.cosmos.cosmos_client

I was trying to do everything according to the next manual: https://learn.microsoft.com/en-us/azure/cosmos-db/create-sql-api-python

like image 432
Erez Fridman Avatar asked Sep 19 '25 15:09

Erez Fridman


1 Answers

Install the latest azure-cosmos package:

pip3 install --upgrade azure-cosmos

and then import the package like this:

from azure.cosmos import exceptions, CosmosClient, PartitionKey

there are more details in the official package page here

like image 177
EladTal Avatar answered Sep 21 '25 05:09

EladTal