When would the -e, --editable option be useful with pip install?
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.
Introduction
pip install -e . is useful when you are actively developing a Python package and want your environment to use the live source code instead of a copied installed snapshot. It saves you from reinstalling the package after every source edit.
What editable install actually changes
A normal install copies built package artifacts into the environment's site-packages directory. An editable install instead arranges things so that imports resolve back to your working source tree.
That means this workflow works naturally:
- install once in editable mode
- edit package source files
- rerun tests or a REPL
- import the updated code without reinstalling
The code is still "installed" from pip's point of view, but the source remains where you are editing it.
The common development workflow
From the project root:
If the project has optional development dependencies, a common variant is:
After that, changes to the package source are immediately visible the next time Python imports the package in a new process.
This is most useful for package authors, not package consumers
Editable mode is ideal when:
- you are developing the package itself
- you are debugging a local dependency
- you are working in a monorepo with multiple local packages
It is usually not the right choice when you simply want to consume a stable released dependency. In that case, a normal versioned install is better because it is reproducible and isolated from ongoing source changes.
Editable installs help local dependency integration
Suppose application A depends on library B, and both live on your machine. Installing B in editable mode lets application A import the current source of B while you iterate on it.
That is especially useful for:
- API design work across packages
- rapid bug fixing in local dependencies
- testing package entry points during development
Without editable mode, you end up repeatedly rebuilding and reinstalling the dependency after every change.
Editable does not mean "everything updates magically"
Most source edits become visible immediately, but metadata changes may still require reinstalling. For example:
- dependency declarations
- package layout changes
- entry point definitions
- build-system configuration changes
Those are installation concerns, not just import-time code concerns.
So editable mode is excellent for code iteration, but not a free pass around all packaging steps.
Modern editable installs rely on packaging support
Historically, editable installs were associated with setup.py develop style behavior. Modern projects using pyproject.toml typically rely on build-backend support for editable installs under modern packaging standards.
In practice, that means editable mode works well for most current packaging tools, but if a backend does not support it properly, the experience may vary.
Not a production deployment strategy
Editable installs are a development tool. Production environments usually want:
- pinned versions
- immutable deployments
- reproducible builds
An editable install points the environment at a mutable working tree, which is the opposite of what most deployment systems want.
Common Pitfalls
- Using editable installs in production or CI when reproducibility matters more than convenience.
- Assuming packaging metadata changes never require reinstalling.
- Forgetting that editable mode is mainly for package development, not ordinary package consumption.
- Installing from the wrong directory and wondering why imports point somewhere unexpected.
- Confusing "editable" with "no installation step at all."
Summary
- '
pip install -e .is most useful when you are actively developing a package.' - It makes the environment import your live source tree instead of a copied snapshot.
- This is especially helpful for local dependency development and rapid iteration.
- Source-code edits are usually reflected immediately, but some packaging changes still require reinstalling.
- Editable installs are a development convenience, not a normal production deployment pattern.
Related reading
- Where can I find source or algorithm of Python's hash function?
- Where do the Python unit tests go?
- Where does pip install its packages?
- Where does pip install its packages?
- Where is a complete example of logging.config.dictConfig?
- Where is the code for gradient descent?
- Where is the documentation for the values method of Enum?
- Where is the downloaded Keras dataset stored?
.png&w=3840&q=75)
Tackling System Design Interview Problems
A short course that equips you with the skills to approach system design interviews methodically.
Start the free courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.