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

# Installing VS Code and Essential Python Extensions

> Step-by-step guide to installing Visual Studio Code and the Python, Pylance, and Jupyter extensions you need for Python AI development.

Getting VS Code installed and properly configured takes only a few minutes. This page walks you through downloading the editor, installing it on your operating system, and adding the key extensions that turn VS Code into a fully capable Python and AI development environment.

## Download and install VS Code

VS Code is available for Windows, macOS, and Linux. Visit [code.visualstudio.com](https://code.visualstudio.com/) — the site detects your operating system automatically and shows the correct download button.

<Steps>
  <Step title="Download the installer">
    Go to [code.visualstudio.com](https://code.visualstudio.com/) and click the download button for your platform.
  </Step>

  <Step title="Run the installer for your OS">
    <Tabs>
      <Tab title="Windows">
        1. Run the downloaded `.exe` installer
        2. Accept the licence agreement
        3. On the **Select Additional Tasks** screen, check all of the following:
           * ✅ Add "Open with Code" to Windows Explorer file context menu
           * ✅ Add "Open with Code" to Windows Explorer directory context menu
           * ✅ Register Code as an editor for supported file types
           * ✅ Add to PATH
        4. Click **Next**, then **Install**, then **Finish**

        <Note>
          The "Add to PATH" option lets you open VS Code from any terminal by typing `code .` — don't skip it.
        </Note>
      </Tab>

      <Tab title="macOS">
        1. Open the downloaded `.zip` file
        2. Drag **Visual Studio Code** into your **Applications** folder
        3. Launch it from Applications (or press `Cmd + Space` and search "Visual Studio Code")

        If macOS shows a security warning on first launch, go to **System Settings → Privacy & Security** and click **Open Anyway**.
      </Tab>

      <Tab title="Linux">
        **Ubuntu / Debian:**

        ```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 (most distributions):**

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

        For other distributions (.rpm, .tar.gz), visit [code.visualstudio.com](https://code.visualstudio.com/) and select your format.
      </Tab>
    </Tabs>
  </Step>

  <Step title="Verify the installation">
    Open VS Code. You should see the **Welcome** tab with a clean, modern interface. If it opens without errors, you are good to proceed.
  </Step>
</Steps>

## Install the Python extension

The Python extension by Microsoft is essential — it adds syntax highlighting, IntelliSense code completion, linting, debugging, and interpreter management.

<Steps>
  <Step title="Open the Extensions panel">
    Click the Extensions icon in the left sidebar (four squares), or press `Ctrl + Shift + X` (Windows/Linux) / `Cmd + Shift + X` (macOS).
  </Step>

  <Step title="Search for and install Python">
    Search for **Python**, find the one published by **Microsoft** (millions of downloads), and click **Install**.
  </Step>
</Steps>

<Note>
  Without the Python extension, VS Code treats `.py` files as plain text. This extension is what enables everything Python-specific in the editor.
</Note>

## Install Pylance and Jupyter

While you have the Extensions panel open, install these two additional Microsoft extensions:

* **Pylance** — provides significantly better type checking, code completion, and import resolution than the base Python extension alone
* **Jupyter** — enables interactive Python execution and `.ipynb` notebook support, which you will use throughout this course

Search for each by name and click **Install**.

<Tip>
  All three extensions (Python, Pylance, Jupyter) are published by Microsoft and work together. Installing them as a group now saves you from interruptions later in the course.
</Tip>

## Enable "Execute in File Directory"

This one setting prevents a very common source of errors for beginners.

<Steps>
  <Step title="Open Settings">
    Press `Ctrl + ,` (Windows/Linux) or `Cmd + ,` (macOS).
  </Step>

  <Step title="Find the setting">
    Search for **Python Terminal Execute In File Dir**.
  </Step>

  <Step title="Enable it">
    Check the box to turn it on.
  </Step>
</Steps>

**Why this matters:** When VS Code runs your Python file, it will now execute from the folder where the file lives, not from your project root. This means `open('data.csv')` in your script will look for `data.csv` in the same folder as your script — which is almost always what you intend.

## Verify Python is detected

After installing the Python extension:

1. Press `Ctrl + Shift + P` (Windows/Linux) or `Cmd + Shift + P` (macOS) to open the Command Palette
2. Type **Python: Select Interpreter**
3. You should see your installed Python version listed

If no interpreter appears, your Python installation may not be on the system PATH. You will resolve this in the virtual environments section.

## Optional: Customise the appearance

These appearance tweaks are optional but worth considering if you plan to spend a lot of time in the editor.

| What          | Extension / Setting                                    |
| ------------- | ------------------------------------------------------ |
| Dark theme    | Search for **Atom One Dark Theme** in Extensions       |
| File icons    | Search for **Material Icon Theme** by Philipp Kief     |
| Folder indent | Settings → search **tree indent** → change `8` to `20` |

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