# What Is an Editable Install?

An editable install (also called a "development install") installs a Python package so that changes to the source code are immediately reflected in the environment without requiring reinstallation. Both [pip](https://pydevtools.com/handbook/reference/pip.md) and [uv](https://pydevtools.com/handbook/reference/uv.md) support editable installs via the `-e` flag. Use them during active development; do not use them in production environments.

## Run an editable install

From the project root:

```bash
pip install -e .
```

With uv's pip-compatible interface:

```bash
uv pip install -e .
```

With a [uv project](https://pydevtools.com/handbook/tutorial/create-your-first-python-project.md), `uv sync` handles this automatically for the project's own package when `[build-system]` is present in `pyproject.toml`.

## How the .pth file links source to site-packages

An editable install places a `.pth` file in the Python environment's `site-packages` directory instead of copying the package files there. That `.pth` file points Python's import system to the development directory containing the source code, so your IDE finds the actual source files rather than installed copies.

Compiled extensions are not automatically rebuilt when you change their source code. Recompile them manually after modifying C extension code.

## Watch for these edge cases

- Moving or renaming the source directory breaks the `.pth` pointer silently; reinstall with `-e` after any such move.
- Data files and package resources may resolve to source-tree paths rather than installed paths. Verify the behavior with a real [wheel](https://pydevtools.com/handbook/reference/wheel.md) install before publishing.

## How PEP 660 standardized editable installs

[PEP 660](https://pydevtools.com/handbook/explanation/what-is-pep-660.md) introduced a standard hook API that any [PEP 517](https://pydevtools.com/handbook/explanation/what-is-pep-517.md)-compliant [build backend](https://pydevtools.com/handbook/explanation/what-is-a-build-backend.md) can implement to support editable installs. Before PEP 660, editable installs were only available through [setuptools](https://pydevtools.com/handbook/reference/setuptools.md)' `setup.py develop` command. The PEP decoupled this workflow from setuptools, allowing backends like [Hatch](https://pydevtools.com/handbook/reference/hatch.md) and [Flit](https://pydevtools.com/handbook/reference/flit.md) to support editable installs through a common interface.
