What does `pip install -e .` (an editable install) do, and why is it useful during local development?
Answer
An editable install registers a package in the current environment without copying its files into `site-packages`; instead it exposes the project's source directory to the environment through a backend-defined mechanism (PEP 660, typically a small finder or path hook rather than a literal symlink), so an ordinary Python source-code change typically takes effect the next time the package is imported, without a reinstall step. This is the standard workflow for developing a library alongside an application that depends on it. The exact mechanics are backend-defined rather than one universal guarantee, though: adding a new module, changing build-time metadata like console-script entry points, or touching anything that requires a compiled extension to be rebuilt can still require rerunning the editable install, so "every change takes effect instantly" is a useful approximation rather than an absolute rule.
Strong answer includes
- exposes the source directory via a backend-defined mechanism (PEP 660), not necessarily a literal symlink
- plain source changes typically take effect without reinstalling
- new modules, metadata changes, or extension rebuilds can still require rerunning the editable install
Practical example
pip install -e ./mylibinside an application's virtual environment lets a developer edit `mylib` 's source directly and see the change reflected in the running application on the very next import, without reinstalling.