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

# prime env install

> Install an environment package

## Overview

The `prime env install` command installs environment packages from three sources:

1. **Environments Hub** - Public and private environments from `app.primeintellect.ai`
2. **Local directory** - Environments in your `./environments` folder
3. **GitHub repository** - Environments from the verifiers repo

## Usage

```bash theme={null}
prime env install <env> [OPTIONS]
```

## Arguments

<ParamField path="env" type="string" required>
  Environment identifier. Format depends on the source:

  * **Hub**: `owner/name` or `owner/name@version`
  * **Local**: `env-name` (looks in `./environments/`)
  * **Repo**: Use with `--from-repo` flag
</ParamField>

## Options

<ParamField path="--path" type="string" default="./environments">
  Path to environments directory for local installations.

  Aliases: `-p`
</ParamField>

<ParamField path="--from-repo" type="flag">
  Install from the verifiers GitHub repository instead of Hub or local.

  Aliases: `-r`
</ParamField>

<ParamField path="--branch" type="string" default="main">
  Git branch to install from when using `--from-repo`.

  Aliases: `-b`
</ParamField>

## Installation Sources

### Environments Hub

Install public or private environments from the Hub:

```bash theme={null}
# Install latest version
prime env install primeintellect/math-python

# Install specific version
prime env install primeintellect/math-python@1.0.0
```

The Hub provides:

* **Versioned releases** with semantic versioning
* **Private environments** (requires authentication)
* **Automatic dependency resolution**
* **Simple index URLs** for pip-compatible installation

### Local Directory

Install environments from your local workspace:

```bash theme={null}
# Install from ./environments/my_env
prime env install my-env

# Install from custom path
prime env install my-env --path ~/my-envs
```

Local installation uses editable mode (`pip install -e`), so changes to the environment code take effect immediately without reinstalling.

### GitHub Repository

Install environments directly from the verifiers GitHub repo:

```bash theme={null}
# Install from main branch
prime env install gsm8k --from-repo

# Install from specific branch
prime env install gsm8k --from-repo --branch dev
```

## Examples

### Install from Hub

```bash theme={null}
prime env install primeintellect/gsm8k
```

**Output:**

```
Fetching environment details for primeintellect/gsm8k@latest...
Installing primeintellect/gsm8k...
Successfully installed gsm8k
```

### Install Local Environment

```bash theme={null}
# Create and install
prime env init my-env
prime env install my-env
```

**Output:**

```
Installing my-env from ./environments/my_env...
Successfully installed my-env
```

### Install from Repository

```bash theme={null}
prime env install math-python --from-repo
```

**Output:**

```
Installing math-python from verifiers repo (main)...
Successfully installed math-python
```

### Install Specific Version

```bash theme={null}
prime env install primeintellect/math-python@0.1.5
```

## How It Works

### Hub Installation

1. Queries the Environments Hub API for environment metadata
2. Retrieves the simple index URL or direct wheel URL
3. Installs using `uv pip install` with the appropriate index
4. Invalidates Python import caches

### Local Installation

1. Locates the environment directory (e.g., `./environments/my_env`)
2. Installs in editable mode using `uv pip install -e`
3. Environment becomes importable immediately

### Repository Installation

1. Constructs a git+https URL pointing to the environment subdirectory
2. Installs directly from GitHub using `uv pip install`
3. Branch can be specified with `--branch`

## Verifying Installation

Check if an environment is installed:

```bash theme={null}
uv pip show my-env
```

Test the environment:

```bash theme={null}
prime eval run my-env -m gpt-4.1-mini -n 1
```

## Private Environments

For private Hub environments, authentication is required:

1. **Option 1: Use `prime env pull`** to download and install locally:
   ```bash theme={null}
   prime env pull owner/private-env
   cd environments/private_env
   prime env install private-env
   ```

2. **Option 2: Configure authentication** for the simple index URL (contact support for details)

## Troubleshooting

### Environment Not Found

```
Local environment not found: ./environments/my_env
```

**Solution:** Check that the environment directory exists and contains `pyproject.toml`.

### Hub Environment Not Available

```
Failed to fetch environment details: 404 Client Error
```

**Solution:**

* Verify the owner/name spelling
* Check if the environment is private (use `prime env pull` instead)
* Ensure you're using the correct version

### Installation Failed

```
Installation failed: ERROR: Could not find a version that satisfies...
```

**Solution:**

* Check that all dependencies are available
* Verify your Python version meets requirements (`>=3.10`)
* Try updating pip: `uv pip install --upgrade pip`

### Module Import Errors

If the environment installs but can't be imported:

```bash theme={null}
# Invalidate caches
python -c "import importlib; importlib.invalidate_caches()"

# Verify installation
uv pip list | grep my-env
```

## Next Steps

After installation:

1. **Run an evaluation:**
   ```bash theme={null}
   prime eval run my-env -m gpt-4.1-mini
   ```

2. **Check environment defaults:**
   ```bash theme={null}
   cat environments/my_env/pyproject.toml
   ```

3. **Modify and test** (for local installs):
   * Edit environment code
   * Re-run evaluation (changes take effect immediately)

4. **Publish to Hub** (for your own environments):
   ```bash theme={null}
   prime env push my-env
   ```

## Dependency Management

Environments can specify their own dependencies in `pyproject.toml`:

```toml theme={null}
[project]
dependencies = [
    "verifiers>=0.8.0",
    "numpy",
    "requests",
]
```

These dependencies are installed automatically when you install the environment.

## Uninstalling

To remove an installed environment:

```bash theme={null}
uv pip uninstall my-env
```
