Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to setup vscode Python debugger for an app engine app?

After following the steps in the official wiki I keep getting the following error when launching with breakpoints or setting breakpoints:

    /ptvsd/wrapper.py", line 423, in pydevd_request
    os.write(self.pipe_w, s.encode('utf8'))
  File "google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/python/runtime/stubs.py", line 40, in os_error_not_implemented
    raise OSError(errno.ENOSYS, 'Function not implemented')
OSError: [Errno 38] Function not implemented

The application runs anyway but the breakpoints are never hit. It seems that ptvsd is trying to use some method that is blocked by the app engine sandboxed environment. I'm running vscode in a python virtualenv, any clue?

like image 934
Julian Go Avatar asked Sep 09 '18 22:09

Julian Go


People also ask

How to debug Python code in VS Code using the debugger?

By default, the debugger uses the same interpreter selected for your workspace, just like other features of Python extension for VS Code. To use a different interpreter for debugging specifically, set the value for python in launch.json for the applicable debugger configuration.

How do I debug an app in Visual Studio Code?

To debug a simple app in VS Code, press F5 and VS Code will try to debug your currently active file. However, for most debugging scenarios, creating a launch configuration file is beneficial because it allows you to configure and save debugging setup details.

How to run Python code in VSCode?

Run Python code in VSCode. 1 Step 1: Select python interpreter. A system can have multiple Python interpreters. It’s important to use the right interpreter for your project since ... 2 Step 2: Create a new project and open it in workspace. 3 Step 3: Create and run a Python file from the IDE.

How do I debug a Python program?

The simplest way to begin debugging a Python file is to use the Run view and click the Run and Debug button. When no configuration has been previously set, you will be presented with a list of debugging options. Select the appropriate option to quickly begin debugging your code.


1 Answers

My solution was to use PyCharm community edition's debugger, its similar perhaps more capable IDE and debugger for Python specific debugging.

like image 59
Peter Herz Avatar answered Oct 18 '22 07:10

Peter Herz