> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/gradio-app/gradio/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Step-by-step instructions to install Gradio on Windows, macOS, and Linux

# Installation

This guide covers how to install Gradio on your system. We recommend using a virtual environment to keep your projects isolated and avoid dependency conflicts.

## Requirements

<Note>
  **Python 3.10 or higher** is required to use Gradio.
</Note>

You can check your Python version by running:

```bash theme={null}
python --version
```

If you need to install or upgrade Python, download it from [python.org](https://www.python.org/downloads/).

<Tip>
  Depending on your system, you may need to use `python3` instead of `python` throughout these instructions.
</Tip>

## Quick install

The fastest way to install Gradio is using pip, which is included by default in Python:

```bash theme={null}
pip install --upgrade gradio
```

This command installs the latest version of Gradio and all its dependencies.

## Virtual environments (recommended)

A virtual environment is a self-contained directory that holds a Python installation for a particular version of Python, along with additional packages. This keeps your projects isolated and prevents conflicts between different package versions.

### Benefits of virtual environments

* Work on multiple projects with different dependencies
* Avoid version conflicts between packages
* Simplify dependency management
* Enhance project reproducibility

### Installation on Windows

<Steps>
  <Step title="Verify Python installation">
    Ensure you have Python 3.10 or higher installed. Open Command Prompt and run:

    ```bash theme={null}
    python --version
    ```

    If you need to install Python, download it from [python.org](https://www.python.org/).
  </Step>

  <Step title="Create a virtual environment">
    Navigate to your project directory in Command Prompt and create a virtual environment:

    ```bash theme={null}
    python -m venv gradio-env
    ```

    This creates a new directory `gradio-env` in your project folder containing a fresh Python installation.

    <Tip>
      You can use any name instead of `gradio-env` for your virtual environment.
    </Tip>
  </Step>

  <Step title="Activate the virtual environment">
    Activate the virtual environment:

    ```bash theme={null}
    .\gradio-env\Scripts\activate
    ```

    Your command prompt should now show `(gradio-env)` at the beginning, indicating you're working inside the virtual environment.
  </Step>

  <Step title="Install Gradio">
    With the virtual environment activated, install Gradio:

    ```bash theme={null}
    pip install gradio
    ```
  </Step>

  <Step title="Verify installation">
    Verify the installation by running Python and importing Gradio:

    ```python theme={null}
    python
    ```

    Then in the Python interpreter:

    ```python theme={null}
    import gradio as gr
    print(gr.__version__)
    ```

    This will display the installed version of Gradio.
  </Step>
</Steps>

### Installation on macOS and Linux

<Steps>
  <Step title="Verify Python installation">
    Python usually comes pre-installed on macOS and most Linux distributions. Verify by running:

    ```bash theme={null}
    python --version
    ```

    Ensure you have Python 3.10 or higher. If not, download it from [python.org](https://www.python.org/).

    <Note>
      Depending on your system, you may need to use `python3` instead of `python` throughout these steps.
    </Note>
  </Step>

  <Step title="Create a virtual environment">
    Navigate to your project directory in Terminal and create a virtual environment:

    ```bash theme={null}
    python -m venv gradio-env
    ```

    <Tip>
      You can use any name instead of `gradio-env` for your virtual environment.
    </Tip>
  </Step>

  <Step title="Activate the virtual environment">
    Activate the virtual environment:

    ```bash theme={null}
    source gradio-env/bin/activate
    ```

    Your terminal prompt should now show `(gradio-env)` at the beginning.
  </Step>

  <Step title="Install Gradio">
    With the virtual environment activated, install Gradio:

    ```bash theme={null}
    pip install gradio
    ```
  </Step>

  <Step title="Verify installation">
    Verify the installation by running Python and importing Gradio:

    ```python theme={null}
    python
    ```

    Then in the Python interpreter:

    ```python theme={null}
    import gradio as gr
    print(gr.__version__)
    ```

    This will display the installed version of Gradio.
  </Step>
</Steps>

## Alternative installation methods

### Using conda

If you use Anaconda or Miniconda, you can install Gradio using conda:

```bash theme={null}
conda create -n gradio-env python=3.10
conda activate gradio-env
pip install gradio
```

<Note>
  Gradio is not available directly through conda, so you still need to use pip after creating your conda environment.
</Note>

### Installing from source

To install the latest development version of Gradio from GitHub:

```bash theme={null}
pip install git+https://github.com/gradio-app/gradio.git
```

<Warning>
  The development version may be unstable. Use this only if you need the latest features or bug fixes.
</Warning>

## Upgrading Gradio

To upgrade to the latest version of Gradio:

```bash theme={null}
pip install --upgrade gradio
```

## Next steps

Now that you have Gradio installed, you're ready to build your first app:

<CardGroup cols={2}>
  <Card title="Quickstart" icon="play" href="/quickstart">
    Build your first Gradio app in minutes
  </Card>

  <Card title="Introduction" icon="book" href="/introduction">
    Learn more about what Gradio can do
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.