Skip to main content

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

Python 3.10 or higher is required to use Gradio.
You can check your Python version by running:
python --version
If you need to install or upgrade Python, download it from python.org.
Depending on your system, you may need to use python3 instead of python throughout these instructions.

Quick install

The fastest way to install Gradio is using pip, which is included by default in Python:
pip install --upgrade gradio
This command installs the latest version of Gradio and all its dependencies. 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

1

Verify Python installation

Ensure you have Python 3.10 or higher installed. Open Command Prompt and run:
python --version
If you need to install Python, download it from python.org.
2

Create a virtual environment

Navigate to your project directory in Command Prompt and create a virtual environment:
python -m venv gradio-env
This creates a new directory gradio-env in your project folder containing a fresh Python installation.
You can use any name instead of gradio-env for your virtual environment.
3

Activate the virtual environment

Activate the virtual environment:
.\gradio-env\Scripts\activate
Your command prompt should now show (gradio-env) at the beginning, indicating you’re working inside the virtual environment.
4

Install Gradio

With the virtual environment activated, install Gradio:
pip install gradio
5

Verify installation

Verify the installation by running Python and importing Gradio:
python
Then in the Python interpreter:
import gradio as gr
print(gr.__version__)
This will display the installed version of Gradio.

Installation on macOS and Linux

1

Verify Python installation

Python usually comes pre-installed on macOS and most Linux distributions. Verify by running:
python --version
Ensure you have Python 3.10 or higher. If not, download it from python.org.
Depending on your system, you may need to use python3 instead of python throughout these steps.
2

Create a virtual environment

Navigate to your project directory in Terminal and create a virtual environment:
python -m venv gradio-env
You can use any name instead of gradio-env for your virtual environment.
3

Activate the virtual environment

Activate the virtual environment:
source gradio-env/bin/activate
Your terminal prompt should now show (gradio-env) at the beginning.
4

Install Gradio

With the virtual environment activated, install Gradio:
pip install gradio
5

Verify installation

Verify the installation by running Python and importing Gradio:
python
Then in the Python interpreter:
import gradio as gr
print(gr.__version__)
This will display the installed version of Gradio.

Alternative installation methods

Using conda

If you use Anaconda or Miniconda, you can install Gradio using conda:
conda create -n gradio-env python=3.10
conda activate gradio-env
pip install gradio
Gradio is not available directly through conda, so you still need to use pip after creating your conda environment.

Installing from source

To install the latest development version of Gradio from GitHub:
pip install git+https://github.com/gradio-app/gradio.git
The development version may be unstable. Use this only if you need the latest features or bug fixes.

Upgrading Gradio

To upgrade to the latest version of Gradio:
pip install --upgrade gradio

Next steps

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

Quickstart

Build your first Gradio app in minutes

Introduction

Learn more about what Gradio can do