# perform_install_extra

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/update_check/perform_install_extra)

Add `extra` to the installed dcode tool environment.

Runs `uv tool install --reinstall -U 'deepagents-code[<extras>]==<current>'
--prerelease allow`, preserving any extras that are already installed.
Command construction and execution hold the shared update/install lock so a
concurrent install, removal, or upgrade cannot rebuild from a stale receipt.
Editable installs are refused — the caller should rerun their
`uv tool install --editable` command with `--with 'deepagents-code[<extra>]'`
added so the extra is resolved against the editable source.

## Signature

```python
perform_install_extra(
    extra: str,
    *,
    progress: UpgradeProgressCallback | None = None,
    log_path: Path | None = None,
) -> ExtraInstallOutcome
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `extra` | `str` | Yes | The extra name to install. Must satisfy `is_valid_extra_name`; invalid names are rejected without invoking uv (defense in depth against shell injection via the `--force`/`--yes` bypass paths). |
| `progress` | `UpgradeProgressCallback \| None` | No | Optional callback invoked for each output line. (default: `None`) |
| `log_path` | `Path \| None` | No | Optional path to persist command output. (default: `None`) |

## Returns

`ExtraInstallOutcome`

The install outcome. `output` is the combined stdout/stderr, or an
explanatory error message when the install method is unsupported or
`extra` is malformed. `manual_recovery_safe` is `False` when the
failure was lock contention, so callers suppress a recovery command
that would bypass the lock another process holds.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/2069079e09546060f5b52b2cd4f0e3c813e820f3/libs/code/deepagents_code/update_check.py#L4001)