How to Install gradio in Python
Python library for easily interacting with trained machine learning models
pip install gradio
What is gradio?
Python library for easily interacting with trained machine learning models
Website | Documentation | Guides | Getting Started | Examples
Gradio: Build Machine Learning Web Apps — in Python
Gradio is an open-source Python package that allows you to quickly build a demo or web application for your machine learning model, API, or any arbitrary Python function. You can then share a link to your demo or web application in just a few seconds using Gradio's built-in sharing features. No JavaScript, CSS, or web hosting experience needed!
Quick Start
Minimal example to get started with gradio:
import gradio
print(gradio.__version__)
Installation
pip (standard)
pip install gradio
Virtual environment (recommended)
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install gradio
pip3
pip3 install gradio
conda
conda install -c conda-forge gradio
Poetry
poetry add gradio
Dependencies
Installing gradio will also install these packages:
Verify the Installation
After installing, confirm the package is available:
python -c "import gradio; print(gradio.__version__)"
If this prints a version number, installation succeeded. If you see a ModuleNotFoundError, see the errors section below.
Installation Errors
Common errors when installing gradio with pip.
ModuleNotFoundError: No module named 'gradio'
Cause: The package is not installed in the current Python environment.
Fix: Run pip install gradio. If using a virtual environment, ensure it is activated first.
ModuleNotFoundError: No module named 'gradio' (installed but still failing)
Cause: pip installed the package into a different Python than the one running your script.
Fix: Use python -m pip install gradio to install into the interpreter you are running.
ImportError: cannot import name 'X' from 'gradio'
Cause: The function or class does not exist in the installed version.
Fix: Check the version with pip show gradio and upgrade with pip install --upgrade gradio.
pip: command not found
Cause: pip is not in PATH or Python was not added to PATH during installation.
Fix: Try python -m pip install gradio. On macOS/Linux try pip3.
PermissionError: [Errno 13] Permission denied
Cause: No write access to the system Python package directory.
Fix: Use a virtual environment, or add --user: pip install --user gradio
SSL: CERTIFICATE_VERIFY_FAILED
Cause: pip cannot verify PyPI's SSL certificate — common behind corporate proxies.
Fix: Try: pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org gradio
MemoryError when loading data
Cause: Dataset is too large to fit in RAM.
Fix: Read in chunks, filter columns on load, or consider Polars/Dask for out-of-core processing.
Recent Releases
| Version | Released |
|---|---|
6.12.0 latest |
2026-04-10 |
6.11.0 |
2026-04-03 |
6.10.0 |
2026-03-24 |
6.9.0 |
2026-03-06 |
6.8.0 |
2026-02-27 |
Manage gradio
Upgrade to latest version
pip install --upgrade gradio
Install a specific version
pip install gradio==6.12.0
Uninstall
pip uninstall gradio
Check what is installed
pip show gradio