When I run dev_appserver.py . (in the directory containing app.py ), being in virtualenv with Python 2.7.12, I get this error and output:
(.venv)$ dev_appserver.py . INFO 2017-02-21 18:54:47,250 devappserver2.py:764] Skipping SDK update check. INFO 2017-02-21 18:54:47,273 api_server.py:268] Starting API server at: http://localhost:35473 INFO 2017-02-21 18:54:47,276 dispatcher.py:199] Starting module "default" running at: http://localhost:8080 INFO 2017-02-21 18:54:47,276 admin_server.py:116] Starting admin server at: http://localhost:8000 Traceback (most recent call last): File "/opt/gcloud/google-cloud-sdk/platform/google_appengine/_python_runtime.py", line 101, in <module> _run_file(__file__, globals()) File "/opt/gcloud/google-cloud-sdk/platform/google_appengine/_python_runtime.py", line 97, in _run_file execfile(_PATHS.script_file(script_name), globals_) File "/opt/gcloud/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/python/runtime.py", line 185, in <module> main() File "/opt/gcloud/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/python/runtime.py", line 165, in main sandbox.enable_sandbox(config) File "/opt/gcloud/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/python/sandbox.py", line 198, in enable_sandbox __import__('%s.threading' % dist27.__name__) File "/opt/gcloud/google-cloud-sdk/platform/google_appengine/google/appengine/dist27/threading.py", line 11, in <module> import warnings File "/opt/gcloud/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/python/sandbox.py", line 1001, in load_module raise ImportError('No module named %s' % fullname) ImportError: No module named warnings
Works great when I'm not in virtualenv. The warnings module is part of the python standard library, as I understand it, so I'm not sure what to do here. Running pip install warnings does not help.
How to get dev_appserver.py to run in virtualenv?
source share