OK all problems fixed! 

The origin of the problems was that I had installed Python App Engine 2.7 
before all of this, and trying to migrate  to App Engine 3.7.
The problem was that "/usr/lib/google-cloud-sdk/platform/google_appengine" 
was in my PYTHONPATH. Probably because this directory contains a "google" 
subdirectory, but no "type" subdirectory inside "google". I'm not sure if 
this was the problem... What I did that fixed this was i ran "sudo apt 
remove google-cloud-sdk" and then installed again the latest SDK with "sudo 
apt-get update && sudo apt-get install google-cloud-sdk", which didn't 
create this folder again. It created "/usr/lib/google-cloud-sdk/platform/" 
but with no "google_appengine" inside it. Also I should have a look at how 
to remove that dir from my PYTHONPATH as it doesn't exist any more.

After all this I just had to create an authentication and setting "export 
GOOGLE_APPLICATION_CREDENTIALS="pah to file.json", and then "python 
main.py" started the application using python 3.6 interpreter.
Thanks!

El viernes, 28 de septiembre de 2018, 1:28:34 (UTC+1), vvv vvv escribió:
>
>
> Hello, after installing everything, I am trying to run
> * 
> ~/python-docs-samples/appengine/standard_python37/building-an-app/building-an-app-2*
> *building-an-app/building-an-app-1* built and run successfully, my 
> problem is with the rest in the series which use the cloud datastore.
> When i start my virtual environment and run
> pip3 install -r requirements.txt
>
> python3 main.py
>
>
> I get Traceback (most recent call last):
>   File "main.py", line 20, in <module>
>     from google.cloud import datastore
>   File 
> "/home/neptune/env/local/lib/python3.6/site-packages/google/cloud/datastore/__init__.py"
> , line 61, in <module>
>     from google.cloud.datastore.batch import Batch
>   File 
> "/home/neptune/env/local/lib/python3.6/site-packages/google/cloud/datastore/batch.py"
> , line 24, in <module>
>     from google.cloud.datastore import helpers
>   File 
> "/home/neptune/env/local/lib/python3.6/site-packages/google/cloud/datastore/helpers.py"
> , line 24, in <module>
>     from google.type import latlng_pb2
> ModuleNotFoundError: No module named 'google.type'
>
>
> If on the other hand I run:
>
> pip install -r requirements.txt
>
> python main.py
>
>
> The output is:
>   File "main.py", line 22, in <module>
>     datastore_client = datastore.Client()
> ...
>     psep = app_id.find(_PARTITION_SEPARATOR)
> AttributeError: 'NoneType' object has no attribute 'find'
>
>
> I found here (
> https://github.com/GoogleCloudPlatform/google-cloud-datastore/issues/168) 
> in the end that I have to set APPLICATION_ID. How do I do this, and is this 
> documented somewhere?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/38e0b122-8f98-4edf-9c66-36a10e2136eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to