> ## Documentation Index
> Fetch the complete documentation index at: https://python4ai.codewithsiva.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# 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.

<Tabs>
  <Tab title="Windows">
    1. Go to [code.visualstudio.com](https://code.visualstudio.com/)
    2. Click the big download button (it detects Windows automatically)
    3. Run the downloaded installer
    4. **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
    5. Click "Next" and "Install"
    6. Click "Finish" when done
  </Tab>

  <Tab title="macOS">
    1. Go to [code.visualstudio.com](https://code.visualstudio.com/)
    2. Click the download button (it detects macOS automatically)
    3. Open the downloaded `.zip` file
    4. Drag **Visual Studio Code** to your **Applications** folder
    5. Optional but recommended:
       * Right-click VS Code in Applications
       * Select "Options" > "Keep in Dock"

    **First time opening**:

    * You might see "Visual Studio Code is from an unidentified developer"
    * Go to System Preferences > Security & Privacy
    * Click "Open Anyway"
  </Tab>

  <Tab title="Linux">
    VS Code is available through multiple installation methods:

    **Ubuntu/Debian** (recommended):

    ```bash theme={null}
    # Download the .deb package
    wget -O vscode.deb "https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64"

    # Install it
    sudo apt install ./vscode.deb
    ```

    **Snap package** (works on most distributions):

    ```bash theme={null}
    sudo snap install code --classic
    ```

    **Other distributions**:
    Visit [code.visualstudio.com](https://code.visualstudio.com/) and select your package format (.rpm, .tar.gz, etc.)
  </Tab>
</Tabs>

## Verify installation

Once installed, let's make sure VS Code is working:

1. Open VS Code:
   * **Windows**: Search "Visual Studio Code" in Start menu
   * **macOS**: Find it in Applications or press `Cmd + Space` and search
   * **Linux**: Type `code` in terminal or find it in your applications menu

2. You should see the Welcome tab

3. The interface should look clean and modern

## Install Python extension

VS Code needs the [Python extension](https://marketplace.visualstudio.com/items?itemName=ms-python.python) to work properly with Python files:

1. Click the Extensions icon in the left sidebar (it looks like 4 squares)
2. Search for "Python"
3. Find the one by **Microsoft** (it has millions of downloads)
4. Click "Install"
5. Wait for installation to complete

<Note>
  The Python extension adds syntax highlighting, code completion, debugging, and more. It's essential for Python development.
</Note>

## Configure Python execution

After installing the Python extension, enable this important setting:

1. Open Settings (`Ctrl/Cmd + ,`)
2. Search for "Python Terminal Execute In File Dir"
3. 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`, then `Ctrl/Cmd + T` to 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

<Tip>
  **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.
</Tip>

## Check Python detection

After setting up VS Code:

1. Press `Ctrl + Shift + P` (Windows/Linux) or `Cmd + Shift + P` (macOS)
2. Type "Python: Select Interpreter"
3. You should see your Python installation listed
4. If not, we'll fix this in the next section

<Card title="Create a workspace" icon="folder-open" href="/getting-started/vscode-workspace">
  Learn how to organize your Python projects
</Card>
