Debugger option using dev_appserver - python 3

Former Community Member
Not applicable

Hello,

I am trying to figure out if I can use a debugger (with breakpoints etc.) using dev_appserver on localhost on a mac, using Python 3.11.

Any suggestions/advice on whether it is feasible or not and if yes, what are the steps to follow?

Thanks

Sajal

1 1 95
1 REPLY 1

Hi @Former Community Member,

Welcome to Google Cloud Community!

Debugging App Engine Python locally on macOS with Python 3.11 isn't directly supported, but you have options:

1. Cloud Debugger (recommended):

  • Enable service, install library, add debug statements in code.
  • Start app with --cloud-debugger flag.
  • Use Google Cloud Console Debugger to connect and debug visually or in command line.

2. pdb and debugpy (more involved):

  • Install debugpy, start it in separate terminal.
  • Add debugpy import and connection code in your app.
  • Start app with dev_appserver.
  • Use remote debugger (PyCharm, VS Code) to connect to port opened by debugpy.

Both methods require code modifications. Cloud Debugger is officially recommended, while pdb and debugpy offer more flexibility but might affect app behavior.