1
votes

I am writing after a lot of searching and trial and error with no luck.

I am trying to deploy a service in app engine. You might be aware that deploying on app engine is usually practiced a two step process 1. Deploy on local dev app server 2. If step 1 succeeds deploy on cloud

My problems are with step 1 when I include third party python libraries such as numpy, sklearn, gcloud etc.

I am trying to deploy a service in local devapp server. When I import numpy or any other third party libraries in my main.py script it throws an error saying unable to find the module.

I am using cloud sdk and have two python distributions, the default python 2.7 and anaconda with python 2.7. When I change the path to look for the modules in anaconda distribution, it fails to find module ‘setup’ required by the cloud sdk.

Is there a way to install the cloud sdk for anaconda distribution ?

Any help/pointers will be much appreciated!

1
Are you using a flexible env or standard environment? which command are you using to run your local server? - atimothee
the environment was pointing to the standard python27 but I also have anaconda with all the necessary modules. The error about import setup module is after I change the environment variable to look for modules in anaconda distribution. The command I am using is - C:\Users\<myusername>\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin>python dev_appserver.py C:\<folder_with_main_and_app_yaml_files> - sumoka
looks like I am supposed to to edit install.bat to set CLOUDSDK_PYTHON="anaconda python". Any idea where I should make this change? - sumoka

1 Answers

1
votes

When using app engine python standard environment, you can install pure python 3rd party libs using pip by vendoring them as explained here.

There are also a number of libraries included in the python27 runtime which can be requested using the libraries directive in your app.yaml as explained here.

If there's a lib which is not pure python (i.e it uses C extensions) that you want to use in your project, and it's not part of this list, then your only option is to use a flexible VM. If you want to use anaconda, you should consider customizing the runtime for your flexible VM.