title: "Stackdriver Debugger is not set up for the python runtime on GAE Flex" Warning
body: <p>I'm attempting to debug a Flask/Python app running on Google Appengine flexible environment.</p>
  
  <p>However, I see a warning message within the Stackdriver Debug interface in Google Console, and am unable to set any breakpoints.</p>
  
  <p>The warning reads:</p>
  
  <blockquote>
    <p>Stackdriver Debugger is not set up for the python runtime on GAE Flex</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/PLM4K.png" rel="nofollow noreferrer">Screenshot of warning</a></p>
  
  <p>Any thoughts on what I'm doing wrong?</p>
  
  <p>I've:</p>
  
  <ul>
  <li>Enabled the Stackdriver Debugger API (as mentioned <a href="https://cloud.google.com/debugger/docs/setup/" rel="nofollow noreferrer">here</a>)</li>
  <li>Imported and initialised the Debugger (following the instructions <a href="https://cloud.google.com/debugger/docs/setup/python" rel="nofollow noreferrer">here</a>)</li>
  <li>Included google-python-cloud-debugger in requirements.txt</li>
  </ul>
  
  <p><strong>main.py (the app entry point defined in app.yaml)</strong></p>
  
  <pre><code>from werkzeug.serving import run_simple
  from werkzeug.wsgi import DispatcherMiddleware
  
  from wsgi import api, frontend, manage
  
  try:
      import googleclouddebugger
      googleclouddebugger.AttachDebugger()
  except ImportError:
      pass
  
  app = DispatcherMiddleware(frontend.create_app(), {
      '/api': api.create_app(),
      '/manage': manage.create_app()
  })
  
  if __name__ == '__main__':
      run_simple('0.0.0.0', 5000, app, use_reloader=True, use_debugger=True)
  </code></pre>
  
  <p><strong>app.yaml</strong></p>
  
  <pre><code>runtime: python
  env: flex
  entrypoint: gunicorn -b :$PORT main:app
  
  runtime_config:
    python_version: 2
  
  manual_scaling:
    instances: 1
  
  resources:
    cpu: 1
    memory_gb: 0.5
    disk_size_gb: 10
  
  env_variables:
    SQLALCHEMY_DATABASE_URI: "postgresql+psycopg2://myusername:mypassword!@/instancename?host=/cloudsql/instancename"
  
  beta_settings:
    cloud_sql_instances: "instancename"
  </code></pre>
  
  <h1>Update 1</h1>
  
  <p>After a comment and noticing a urllib import error, I wondered if the wsgi nature of my application was causing issues. I went back to the <a href="https://github.com/GoogleCloudPlatform/cloud-debug-python" rel="nofollow noreferrer">documentation</a>, saw a note about Django framework doing something similar and changed the following:</p>
  
  <pre><code>googleclouddebugger.AttachDebugger()
  </code></pre>
  
  <p>to</p>
  
  <pre><code>googleclouddebugger.enable()
  </code></pre>
  
  <p>This got rid of the urllib import error, but hasn't resolved the overall issue.</p>