Install Visual Studio Code
Download the official VS Code installer and proceed with default installation steps. After setup, install the Python extension from the marketplace.
Verify whether Conda is accessible from the system path:
Win + R → cmd → conda
If Conda returns version or help info, skip the next section. Otherwise, configure environment variables.
Configure Conda in System Path
Locate the Scripts directory inside the Anaconda installation folder (for example, C:\Anaconda3\Scripts). Copy its full path.
Open system environment settings:
- Press
Win + S, type Edit the system environment variables, and open it. - In the System Properties dialog, select Environment Variables.
- Under System variables, find and select
Path, then click Edit. - Add a new entry containing the copied Scripts path.
Select Conda Interpreter in VS Code
Trigger the quick command palette with Ctrl + P, enter > Python: Select Interpreter, and choose the desired Conda environment from the list.
Python Execution Setup
Ensure the Python installer includes the option Add Python to PATH. With this setting enabled, running .py files directly within VS Code will invoke the correct interpreter.
For C/C++ development:
- Dwonload binaries from the official distribution site.
- Extract the archive and append the
bindirectory path to the systemPathvariable.
Additional Configuration Options
-
Missing IntelliSense for Methods: Navigate to File > Preferences > Settings (or
Ctrl + ,), search for@tag:usesOnlineServicesor locate TypeScript: Disable Automatic Type Acquisition and enable it to restore method hints. -
Python Code Formatting: Use
Shift + Alt + F. Install an extension such as Black Formatter or autopep8 for consistent styling. -
No Autocompletion: Restart the Pylance language server via the command palette (
Ctrl + Shift + P→Python: Restart Language Server). -
Auto-Save Files: Open settings (
Ctrl + ,), find Auto Save, and set it to onFocusChange. -
Step Into Library Code During Debugging: In settings, disable Just My Code:
- Open settings, search for
justMyCode, and uncheck it.
- Open settings, search for
-
Navigate Cursor to Previous Position: Assign shortcuts for Go Back and Go Forward navigation:
Ctrl + KthenCtrl + Sopens keyboard shortcuts editor.- Search for Go Back and assign e.g.,
Alt + Left; for Go Forward, assignAlt + Right.
-
Expand Empty Folder Nodes: In settings, search for Compact Folders and uncheck the option to dispplay empty directories expanded.
-
Highlight Search Matches in Terminal: Modify
settings.json:- Open command palette (
Ctrl + Shift + P) → Preferences: Open Settings (JSON). - Add custom color rules under
workbench.colorCustomizations:
- Open command palette (
{
"workbench.colorCustomizations": {
"terminal.findMatchHighlightBackground": "#fdf9c3",
"terminal.findMatchBorder": "#e6b800",
"terminal.findMatchHighlightBorder": "#ffcc00"
}
}