I am using Google Cloud to deploy a relatively small but computationally intensive Python application. I am using Flask. Since the current version of my app is really slow (I am not storing computed values for future reuse), I am hoping to use the Appengine Memcache. For that, I have the following line of code within my python file: from google.appengine.api import memcache
When I try to deploy this (gcloud app deploy
), the deployment packaging works for about 8-10 minutes before stopping with this error: No module named appengine.api
I have installed Google Cloud SDK (/usr/local/Google-Cloud-SDK
- I'm on OSX). I have also installed the Python Libraries: https://googlecloudplatform.github.io/google-cloud-python/
I have looked at some related issues here & tried the proposed solutions: remove protobuf
, modified $PYTHONPATH
move directories, and remove/reinstall. None of them seem to work. Reached out to Google as well but they just pointed me to the documentation.
There are a couple things that could be causing this as I went through the same exact issue. (Also OSX)
First, the simplest of the two. For some reason a package called Protobuf likes to mess with your SDK PATH. To get rid of it simply enter in your terminal
pip uninstall protobuf
.(For future Users)After this simply try deploying again. If you are still not successfully deploying try this:
Google has a mostly deprecated piece of software called Appengine Launcher. You can use this to make symlinks to the sdk for your project. In order to get it you have to download the original App-Engine SDK
Once you have downloaded and installed the original sdk, it is really quite simple. It will probably prompt you to make new symlinks upon init, but this is usually not enough. So go to the top menu and click on the launcher and "Make Symlinks" to make more.
After this you should be all set!