I am beginning to test google app engine for running my flask app. I can run the app directly using flask run without a problem. My app.yaml looks like this
runtime: python27
api_version: 1
threadsafe: true
# [START handlers]
handlers:
- url: /static
static_dir: CameraMeerat/static
- url: /.*
script: CameraMeerkat.app
# [END handlers]
When running dev_appserver.py I get
File "C:\Users\Ben\Documents\CameraMeerkat\Frontend\CameraMeerkat\commands.py", line 5, in <module>
from subprocess import call
ImportError: cannot import name call
INFO 2017-07-21 21:26:37,585 module.py:813] default: "GET / HTTP/1.1" 500 -
From my python shell I can run that command
from subprocess import call
help(call)
Help on function call in module subprocess:
call(*popenargs, **kwargs)
Run command with arguments. Wait for command to complete, then
return the returncode attribute.
The arguments are the same as for the Popen constructor. Example:
retcode = call(["ls", "-l"])
What might be going on here? Subprocess is not a module that can be installed, or really messed with. Similar to unanswered here
ImportError: cannot import name Popen google cloud compute delpoyment error ?
This is one of the limitation imposed by the GAE standard environment Python sandbox. From The sandbox (emphasis mine):
One of the disallowed system calls is
subprocess.call
. The development server will raise an exception as it contains a modified version ofsubprocess
.If your app requires such call you may need to switch to the flexible enviroment. See also Choosing your App Engine environment