Last active
June 24, 2021 12:24
-
-
Save prabindh/82d701a5e54330ea546b82cd8bd3bb91 to your computer and use it in GitHub Desktop.
Run visual studio code in Conda environment. Allows python debugging
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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