Python Pickle file from cloud storage in flexible environment

2,256 views
Skip to first unread message

Shahin R. Namin

unread,
Nov 14, 2017, 11:09:07 PM11/14/17
to Google App Engine
Hi 
I am working on a project where I need to read and load a pickle dump file from google cloud storage in Python in the app engine flexible environment. 
According to this link, I can read the data using cloudstorage (the GoogleAppEngineCloudStorage dependency). I have tested this on the standard environment and it works, however I cannot read the pickle file in flexible environment and I get the the error

from google.appengine.api import app_identity ImportError: No module named appengine.api

on the line I am importing cloudstorage. 

Has anyone encountered this before? Is it possible to have a code snippet that shows how I can load the pickle file from cloud storage on flexible environment. 

Thank you in advance 

Jordan (Cloud Platform Support)

unread,
Nov 15, 2017, 11:05:33 AM11/15/17
to google-a...@googlegroups.com
The old 'google.appengine.api' is used by the App Engine API and were made specifically to run on the App Engine Standard environment (which was the only hosted solution at the time). 

Now with the new App Engine Flexible environment, Kubernetes Engine, Cloud Functions, etc a new API needed to be made to allow generic access to Google services from any client. This new API is called the Google Cloud API (aka Google Cloud Client Library) and uses a new 'google.cloud' import. 

With this new Cloud Client Library you can use the Google Cloud Storage API to interact with Cloud Storage from the App Engine Flex environment. In your case you would use the new 'download' methods to download your pickle file

- Note that Google Groups are reserved for general product discussions and not for technical support. If you require further technical support for using the new Client Libraries it is recommended to post your full detailed questions to Stack Overflow using the supported Cloud tags. 
Reply all
Reply to author
Forward
0 new messages