Debugging Python 3.x with Visual Studio Code on OSX

OSX comes with Python 2.x by default, and setting the default Python version to 3.x is not without trouble. Here is how you debug Python 3.x applications with Visual Studio Code and the Python extension. Open the application folder in VS Code Create a new launch configuration based on the Python template Add "pythonPath": "/Library/Frameworks/Python.framework/Versions/3.5/bin/python3" to the configuration so that it looks similar to the following: { "name": "Python", "type": "python", "request": "launch", "pythonPath": "/Library/Frameworks/Python.framework/Versions/3.5/bin/python3", "stopOnEntry": true, "program": "${file}", "debugOptions": [ "WaitOnAbnormalExit", "WaitOnNormalExit", "RedirectOutput" ] } And start debugging!

May 7, 2016 ยท Jeppe Lund Andersen