Search code examples
pythonpython-3.xgoogle-app-enginegoogle-cloud-platformgoogle-cloud-datastore

How to access Google cloud library in python3 standard app engine project?


I'm trying to use the datastore in the google cloud sdk.

When I try and import:

from google.cloud import datastore

I get the error:

ModuleNotFoundError: No module named 'google.cloud'

But I do have the google cloud sdk installed and it's available in my lib directory:

enter image description here

The problem seems to be that when I try and import it another google folder is used:

enter image description here

Edit: After running pip3 install --upgrade google-cloud-datastore I can now import google.cloud from the command line but it still does not work in my project.

What next steps can I take to solve this issue?


Solution

  • I managed to reproduce the issue that you got. If we follow the documentation here then indeed it doesn't work. However, if you run pip3 install --upgrade google-cloud-datastore then it does the trick.