What does pip install -e do? Editable installs explained
Codemia Knowledge Hub ·
pip install -e is for package development. It installs a project in editable mode, so the environment imports your current source tree directly and you can change the code and test it without reinstalling after every edit.
What editable mode means
A normal pip install . builds the package and installs it into the environment. Editable mode still counts as installed from pip's point of view, but imports point back to your working source directory.
Typical usage:
After that, every new Python process sees your edits to the project's modules immediately. That fast iteration loop is the core use case.
Who benefits
Editable installs help most when:
- you are building a library
- you are testing a local package from an application
- you are working in a monorepo with multiple Python packages
Without editable mode, each source change often turns into a cycle of editing the code, reinstalling the package and rerunning the tests. Editable installs remove the reinstall step for most ordinary source changes.
Example with a local package
Given this layout:
From the project root:
If you then edit core.py, test runs and REPL imports use the updated source without another install.
Using a local library from another project
Editable mode also helps when one local project depends on another. If application A depends on library B and you are editing B, installing B with -e lets A use the updated code immediately. That is often the cleanest workflow.
Changes that still need a reinstall
Editable mode covers source code changes. You still need to reinstall after:
- dependency changes
- package metadata changes
- console script entry point changes
- packaging configuration changes
Why not to use it in production
Editable installs are usually the wrong choice for production or locked-down CI images, because they point at a mutable working tree. Production systems usually want pinned versions, immutable artifacts and reproducible installs. Editable mode trades immutability for flexibility.
Editable installs with pyproject.toml
Editable installs used to be tied to setup.py workflows. Modern Python packaging supports them through current build backends that implement the right hooks. In practice the behavior is the same: the environment imports your live source tree while treating the project as an installed package.
Common mistakes
- Using editable mode in production, where reproducibility matters more than convenience.
- Assuming packaging metadata changes never need a reinstall.
- Running the command outside the project root that contains the packaging metadata.
- Thinking an editable install means no installation happened.
- Doing a normal install while actively developing the package, then wondering why edits do not show up.
Related reading
- What is the use of "assert" in Python?
- What is the use of join in threading?
- What is the use of python-dotenv?
- What is the use of PYTHONUNBUFFERED in docker file?
- What is the use of train_on_batch in keras?
- What is thread local storage in Python, and why do I need it?
- What kind of problems if any would there be combining asyncio with multiprocessing?
- What makes WSGI is synchronous in nature?
System design interview problems on this topic
- Design a Web Crawler: solution and walkthrough
- Design a Task Scheduler: solution and walkthrough
- Design a URL Shortener (TinyURL): solution and walkthrough
- Design an API Rate Limiter: solution and walkthrough
.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 courseNo course covers this one yet
Basis Lab writes one for you from a sentence about what you want to be able to do, then teaches it and checks you understood. Your first course is free.
Build my courseData Structures & Algorithms practice on Codemia
Step through 300+ coding interview problems with animated visualisers that show the data structure changing as the code runs. The Blind 75 are free.