# uninstall_extra_method_error

> **Function** in `deepagents_code`

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

Return why the install method cannot remove `extra`, if applicable.

The editable check is separate from `detect_install_method`: an editable
checkout installed under a uv tool prefix is reported as `"uv"`, so the
method alone would let a removal through that cannot work. Gating both here
keeps one refusal message and makes `perform_uninstall_extra` safe for any
caller rather than relying on each one to pre-check.

## Signature

```python
uninstall_extra_method_error(
    extra: str,
    *,
    method: InstallMethod | None = None,
) -> str | None
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `extra` | `str` | Yes | Extra name the user asked to remove, used in the hint. |
| `method` | `InstallMethod \| None` | No | Optional pre-detected install method. Defaults to detecting it. (default: `None`) |

## Returns

`str | None`

The refusal message, or `None` when this install can remove extras.

---

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