Skip to content
Latchkey

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 pytest

In 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →