pip install -e: Editable Install Command Reference
Install your own project so imports resolve to the working tree.
pip install -e installs a local project in editable mode, linking the source so code edits take effect without reinstalling. CI uses it to install the package under test.
Common flags / usage
- -e . -- install the current project in editable mode
- -e ".[dev]" -- include an extras group (quote for the shell)
- -e ./libs/common -- install a sibling package from a monorepo path
- --no-build-isolation -- build against the current environment
- --config-settings KEY=VAL -- pass settings to the build backend
Example
shell
- run: python -m venv .venv
- run: .venv/bin/pip install -e ".[dev]"
- run: .venv/bin/python -m pytestIn CI
An editable install needs a build backend declared in pyproject.toml (or a setup.py). Without one, pip errors that the directory is not a Python project. Installing the package editable also puts it on sys.path, fixing many pytest "module not found" collection errors.
Key takeaways
- pip install -e links the source tree so edits apply without reinstalling.
- It requires a build backend in pyproject.toml; declare [build-system] if missing.
- Editable-installing the project makes it importable for pytest collection.
Related guides
pip install: Command Reference for CIReference for pip install in CI pipelines: installing packages, pinning versions, common flags, a GitHub Acti…
python -m build: Build Distributions Command ReferenceReference for python -m build in CI: producing an sdist and wheel in an isolated environment from pyproject.t…
pytest: Run Tests Command Reference for CIReference for pytest in CI: running the suite, useful flags, why python -m pytest fixes import errors, and a…