# perform_install_package

> **Function** in `deepagents_code`

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

Add an arbitrary `package` to the installed dcode tool environment.

Runs `uv tool install --reinstall -U 'deepagents-code[<extras>]==<current>'
--with <package> --prerelease allow`, the escape hatch for a provider whose
package is not a `deepagents-code` extra (e.g. a custom or in-house
`class_path` model). Already-installed extras are preserved so the reinstall
does not drop them.
Editable installs are refused
— the caller should rerun their `uv tool install --editable` command with
`--with <package>` added so it resolves against the editable source.

## Signature

```python
perform_install_package(
    package: str,
    *,
    progress: UpgradeProgressCallback | None = None,
    log_path: Path | None = None,
) -> tuple[bool, str]
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `package` | `str` | Yes | The package name to install. Must satisfy `is_valid_package_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

`tuple[bool, str]`

`(success, output)` — on success, *output* is the combined
stdout/stderr from the install. On failure it is an explanatory
message: when the install method is unsupported, `package` is
malformed, `uv` is unavailable, or the install subprocess fails or
times out.

---

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