How to run the IPython shell in your uv project
When working with uv projects, you might want to use IPython for interactive development without adding it to your project’s dependencies. Running uv run ipython
directly fails because IPython 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)
Option 1: Use IPython Temporarily with –with
Install IPython temporarily for the current session without adding it to your project dependencies:
uv run --with ipython ipython
Note
This does not modify your pyproject.toml or lockfile.
Option 2: Add IPython as a Development Dependency
Add IPython to your project’s development dependencies:
uv add --dev ipython
Then run it normally:
uv run ipython
Note
This approach IPython to your pyproject.toml development dependencies and updates your lockfile for reproducible environments.
Option 3: Install IPython Globally with uv tool
For system-wide IPython access across all projects:
uv tool install ipython
Then run it from any directory:
ipython
Globally installed IPython won’t have access to your project’s dependencies.