I cannot seem to get Python3 to work when debugging it continues to use Python2. I've tried a few things but still am unable to get it work. I verified Python3s path is /usr/local/bin/python3 Everytime I run a script to by
import sys
print(sys.version)
I still get 2.7.10 python 3 is installed and work correctly.
I have this in my launch.json and settings.json (type and request are both grayed out for some reason in the launch.json)
{
"name": "Python",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"program": "${file}",
"pythonPath": "/usr/local/bin/python3",
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit",
"RedirectOutput"
] }
To select a specific python interpreter, invoke the Python: Select Interpreter command from the Command Palette (⇧⌘P).
This will update your .vscode/settings.json file:
{
"python.pythonPath": "/usr/local/bin/python3"
}
You should then be able to debug using python 3 interpreter or any other python interpreter is available on your machine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With