Install VS Code
Download and install Visual Studio Code
Download VS Code
Visual Studio Code is available for all operating systems. The installation is quick and straightforward.
-
Go to code.visualstudio.com
-
Click the big download button (it detects Windows automatically)
-
Run the downloaded installer
-
Important: Check these options during installation:
- ✓ Add "Open with Code" action to Windows Explorer file context menu
- ✓ Add "Open with Code" action to Windows Explorer directory context menu
- ✓ Register Code as an editor for supported file types
- ✓ Add to PATH
-
Click "Next" and "Install"
-
Click "Finish" when done
Verify installation
Once installed, let's make sure VS Code is working:
- Open VS Code:
- Windows: Search "Visual Studio Code" in Start menu
- macOS: Find it in Applications or press
Cmd + Spaceand search - Linux: Type
codein terminal or find it in your applications menu
- You should see the Welcome tab
- The interface should look clean and modern
Install Python extension
VS Code needs the Python extension to work properly with Python files:
- Click the Extensions icon in the left sidebar (it looks like 4 squares)
- Search for "Python"
- Find the one by Microsoft (it has millions of downloads)
- Click "Install"
- Wait for installation to complete
Configure Python execution
After installing the Python extension, enable this important setting:
- Open Settings (
Ctrl/Cmd + ,) - Search for "Python Terminal Execute In File Dir"
- Check the box to enable it
What this does: When you run a Python file, VS Code will execute it from the file's directory instead of your workspace root.
Why I recommend it: This prevents common path-related errors. For example, if your script reads a file with open('data.csv'), it will look for the file in the same folder as your script, which is usually what you want. Without this setting, it would look in your project root instead, causing "file not found" errors.
Additional recommended extensions
While VS Code works great with just the Python extension, here are a few more I recommend:
Pylance
- Search for "Pylance" by Microsoft
- Provides even better code completion and error detection
- Works alongside the Python extension
Jupyter
- Search for "Jupyter" by Microsoft
- Enables interactive Python mode (we'll use this later)
- Essential for data science and AI work
Customize appearance (optional)
I've been using these settings for years - they're easy on the eyes:
Theme
- Install "Atom One Dark Theme"
- Press
Ctrl/Cmd + K, thenCtrl/Cmd + Tto select it
Icons
- Install "Material Icon Theme" by Philipp Kief
- Makes file types easier to recognize
Tree indentation
- Open Settings (
Ctrl/Cmd + ,) - Search for "tree indent"
- Change from 8 to 20 for clearer folder structure
View keyboard shortcuts: Open Command Palette (Ctrl/Cmd + Shift + P) and search "keyboard shortcuts". You can search for any command and change its shortcut by clicking the pencil icon.
Check Python detection
After setting up VS Code:
- Press
Ctrl + Shift + P(Windows/Linux) orCmd + Shift + P(macOS) - Type "Python: Select Interpreter"
- You should see your Python installation listed
- If not, we'll fix this in the next section