# How to run the IPython shell in your uv project

Running `uv run ipython` fails when [IPython](https://pydevtools.com/handbook/reference/ipython.md) isn't installed in the project environment:

```
$ uv run ipython
error: Failed to spawn: `ipython`
Caused by: No such file or directory (os error 2)
```

## Use IPython for one session

Add IPython for one session without modifying project dependencies:

```bash
uv run --with ipython ipython
```

`uv run` executes the command inside the project's virtual environment, ensuring all dependencies are installed first. The `--with` flag adds IPython for this invocation only. Both [pyproject.toml](https://pydevtools.com/handbook/reference/pyproject.toml.md) and the [lockfile](https://pydevtools.com/handbook/explanation/what-is-a-lock-file.md) stay unchanged.

## Add IPython as a development dependency

The `--dev` flag marks IPython as a {{< term "dev-dependency" "development dependency" >}}, keeping it out of production installs:

```bash
uv add --dev ipython
uv run ipython
```

## Install IPython globally with uv tool

Install it as a [uv](https://pydevtools.com/handbook/reference/uv.md) tool for access across all projects:

```bash
uv tool install ipython
```

> [!WARNING]
> A globally installed IPython runs in its own isolated environment and cannot import your project's dependencies.
