Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

ModuleNotFoundError: No module named 'azure.cosmosdb' #49

Open
aletc1 opened this issue Mar 11, 2020 · 2 comments
Open

ModuleNotFoundError: No module named 'azure.cosmosdb' #49

aletc1 opened this issue Mar 11, 2020 · 2 comments

Comments

@aletc1
Copy link

aletc1 commented Mar 11, 2020

Hi,

I received the following error when importing this library:

ModuleNotFoundError: No module named 'azure.cosmosdb'

I have installed the lates version (1.0.6) using pip:

pip install -U azure-cosmosdb-table

But, this doesnt work:

python3 -c 'from azure.cosmosdb.table import TableService'

I am using Python 3.7 (version which I havent seen in the requirements) Is Python 3.7 not supported or there is something else? Will 3.7 be supported?

Thanks

@hereisok
Copy link

@aletc1
Make sure your library is installed under python3 and not python2.
You can have a try.
pip3 install -U azure-cosmosdb-table

@aletc1
Copy link
Author

aletc1 commented Apr 15, 2020

Thanks @hereisok but I have an alias for pip3. In any case, I just did it again with pip3 with same results.

I have found what the issue was and it is related to the location of python packages.
If I do this pip3 install -U azure-cosmosdb-table then the azure folder is installed in ~/.local/lib/python3.7/site-packages (under the user folder). In this scenario, Python cannot locate the module:

python3 -c 'from azure.cosmosdb.table import TableService'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'azure.cosmosdb.table'

But if I use this sudo pip3 install -U azure-cosmosdb-table then is installed under /usr/local/lib/python3.7/dist-packages and works.

If you think that this is an issue related to my environment, you may freely close this, since I solved my problem, but I dont know if there is a real porblem with the azure.cosmosdb module when it is deployed under the user location. I did python -m site and the sys.path is pointing to the right location (and also I checked permissions).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants