Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Run visual studio code in Conda environment. Allows python debugging
Debugging with vscode and conda python:
- Install vs code
- Follow https://medium.com/analytics-vidhya/efficient-way-to-activate-conda-in-vscode-ef21c4c231f2 to add conda terminal to vs code via launch.json. Args have to be added like
"args": ["--aa=2", "--ab=1", "--sm", "--input=asd.img"]
- Close vscode
-- open conda prompt, activate required environment via conda activate myEnv
- launch vscode from the command prompt, using "code"
Place this in settings.json
{
"python.pythonPath": "C:\\Users\\xxc\\anaconda3\\envs\\deep\\python.exe",
"python.terminal.activateEnvironment": true,
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe"
}
launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment