# Dependencies for Running OpenEnv: Complete Installation Guide

> Install OpenEnv with ease. Discover the core Python dependencies like FastAPI, Pydantic, and Uvicorn needed to run this powerful environment tool from huggingface.

- Repository: [Hugging Face/OpenEnv](https://github.com/huggingface/OpenEnv)
- Tags: getting-started
- Published: 2026-06-16

---

**OpenEnv requires a minimal core set of Python packages including FastAPI ≥0.116, Pydantic ≥2.0, and Uvicorn ≥0.24, with optional extras available for CLI tools, web interfaces, and environment-specific integrations.**

OpenEnv is a modular Python framework designed for running multi-client protocol (MCP) environments. Understanding the dependencies for running OpenEnv is essential before installation, as the package uses a deliberately lightweight core with optional extras for specific use cases. All dependency specifications are centralized in the repository's [`pyproject.toml`](https://github.com/huggingface/OpenEnv/blob/main/pyproject.toml) file, with additional requirements isolated in individual environment subdirectories to avoid bloating the base installation.

## Core Runtime Dependencies

The essential packages required for the server-side API, request handling, and MCP layer are included in the `openenv[core]` installation target. These dependencies are declared in the `[project.dependencies]` section of [`pyproject.toml`](https://github.com/huggingface/OpenEnv/blob/main/pyproject.toml) and install automatically with the top-level package.

### HTTP Framework and Data Validation

**FastAPI** ≥0.116 powers the OpenEnv REST API server, providing the high-performance ASGI framework that handles HTTP requests. **Pydantic** ≥2.0 manages data validation and settings management throughout the codebase, ensuring type safety for environment configurations and API payloads. **Uvicorn** ≥0.24 serves as the ASGI server that runs the FastAPI application in production environments.

### Communication Protocols

**Requests** ≥2.25 provides client-side HTTP functionality used by utilities and test suites. **Websockets** ≥15.0.1 enables low-level WebSocket support for real-time communication between agents and environments. **FastMCP** ≥3.0 implements the Multi-Client-Protocol layer that facilitates message exchange between agents and environment instances.

## Optional Dependency Groups

OpenEnv organizes additional functionality into optional extras that you can install based on your specific use case. These groups prevent unnecessary bloat when you only need specific capabilities.

### CLI Extras

Installing `openenv[cli]` adds the **Typer** ≥0.9 library, which creates the ergonomic `openenv` command-line interface entry point defined in [`src/openenv/cli/__main__.py`](https://github.com/huggingface/OpenEnv/blob/main/src/openenv/cli/__main__.py). **Rich** ≥13 provides pretty-printing capabilities and progress bars for terminal output. **PyYAML** ≥6 parses configuration files, while **Hugging Face Hub** ≥0.20 enables pulling model files and datasets. **OpenAI** ≥2.7.2 adds optional integration for ChatGPT agents, and **Tomli** ≥2.3 with **Tomli-W** ≥1.2 support reading and writing TOML configuration files.

### Web UI Dependencies

The browser-based interface requires **Gradio** ≥4, which can be launched directly from the package to provide a visual interface for environment interaction. **HTTPX** ≥0.28.1 serves as an async HTTP client used by the UI components and certain environment implementations for non-blocking network requests.

### Specialized Orchestration Tools

For advanced deployment scenarios, the **Daytona** ≥0.136.0 integration adds support for the Daytona orchestration framework. The **Inspect** extra brings in `inspect-ai` for interactive inspection and debugging of running environments.

## Installation Commands

Install only the essential components if you are integrating OpenEnv into an existing application or running headless servers:

```bash
pip install "openenv[core]"

```

For full functionality including the command-line tool and web interface:

```bash
pip install "openenv[all]"

```

You can launch the server immediately after installation:

```python
import subprocess

# Starts the FastAPI application on localhost:8000

subprocess.run(["openenv", "serve"])

```

Programmatic usage requires only the core dependencies:

```python
from openenv.core import EnvClient

client = EnvClient(base_url="http://localhost:8000")
info = client.get_env_info()
print(info)

```

## Environment-Specific Dependencies

Individual environment implementations maintain their own dependency specifications to keep the core package lightweight. Heavy scientific libraries such as **PyTorch**, **NumPy**, or **SmolAgents** are intentionally excluded from the global [`pyproject.toml`](https://github.com/huggingface/OpenEnv/blob/main/pyproject.toml) because they are only required by specific environments.

Each environment subdirectory contains its own [`pyproject.toml`](https://github.com/huggingface/OpenEnv/blob/main/pyproject.toml) file. For example, [`envs/echo_env/pyproject.toml`](https://github.com/huggingface/OpenEnv/blob/main/envs/echo_env/pyproject.toml) declares any additional packages needed specifically for that environment's operation. This modular approach ensures you only install scientific computing libraries for the environments you actually plan to use.

## Key Configuration Files

Understanding the dependency structure requires examining several critical files in the repository:

- **[`pyproject.toml`](https://github.com/huggingface/OpenEnv/blob/main/pyproject.toml)** – Declares the core and optional dependency groups in the `[project.dependencies]` and `[project.optional-dependencies]` sections.
- **[`src/openenv/cli/__main__.py`](https://github.com/huggingface/OpenEnv/blob/main/src/openenv/cli/__main__.py)** – Entry point for the `openenv` command-line interface; imports Typer and Rich to provide the CLI experience.
- **[`src/openenv/core/__init__.py`](https://github.com/huggingface/OpenEnv/blob/main/src/openenv/core/__init__.py)** – Imports core components that rely on FastAPI, Pydantic, and FastMCP.
- **Environment-specific [`pyproject.toml`](https://github.com/huggingface/OpenEnv/blob/main/pyproject.toml) files** (e.g., [`envs/echo_env/pyproject.toml`](https://github.com/huggingface/OpenEnv/blob/main/envs/echo_env/pyproject.toml)) – Isolate heavyweight dependencies to specific use cases.

## Summary

- **Core dependencies** include FastAPI, Pydantic, Uvicorn, Requests, Websockets, and FastMCP for basic server functionality.
- **CLI extras** add Typer, Rich, PyYAML, and Hugging Face Hub integration for command-line usage.
- **Web UI support** requires Gradio and HTTPX for browser-based interfaces.
- **Environment-specific packages** like PyTorch are excluded from the core install and managed per-environment to minimize installation size.
- All dependencies are specified in the root [`pyproject.toml`](https://github.com/huggingface/OpenEnv/blob/main/pyproject.toml) with version constraints ensuring compatibility.

## Frequently Asked Questions

### What are the minimum dependencies required to run OpenEnv?

The minimum installation requires **FastAPI** ≥0.116, **Pydantic** ≥2.0, **Uvicorn** ≥0.24, **Requests** ≥2.25, **Websockets** ≥15.0.1, and **FastMCP** ≥3.0. These provide the HTTP server, data validation, ASGI runtime, and multi-client protocol layer necessary for basic operation.

### How do I install OpenEnv with full CLI support?

Run `pip install "openenv[cli]"` to include **Typer**, **Rich**, **PyYAML**, and **Hugging Face Hub** dependencies. This enables the `openenv` command-line tool entry point defined in [`src/openenv/cli/__main__.py`](https://github.com/huggingface/OpenEnv/blob/main/src/openenv/cli/__main__.py) with full configuration parsing and progress visualization capabilities.

### Why aren't scientific libraries like PyTorch included in the core dependencies?

Scientific libraries such as **PyTorch**, **NumPy**, and **SmolAgents** are excluded from the core [`pyproject.toml`](https://github.com/huggingface/OpenEnv/blob/main/pyproject.toml) to maintain a lightweight base installation. According to the source code, these dependencies are declared in environment-specific [`pyproject.toml`](https://github.com/huggingface/OpenEnv/blob/main/pyproject.toml) files (such as [`envs/echo_env/pyproject.toml`](https://github.com/huggingface/OpenEnv/blob/main/envs/echo_env/pyproject.toml)) and only installed when you use those particular environments.

### Where are the dependency versions specified for OpenEnv?

All dependency specifications are centralized in the repository's **[`pyproject.toml`](https://github.com/huggingface/OpenEnv/blob/main/pyproject.toml)** file at the root level. This file defines both the core dependencies under `[project.dependencies]` and optional groups under `[project.optional-dependencies]`, with specific minimum version constraints for each package.