Notes on Python editable installs

This page is managed by StJohn Piano.

Notes on Python editable installs

If you have any questions, comments, or suggestions - please contact StJohn Piano on Tela:

Situation: You want to build a feature that will require changes to multiple Python packages that are in a dependency chain

It will be easiest to edit all the packages simultaneously.

This can be accomplished by using "editable installs" - the parent package will install a link file in its virtualenv that points to your local copy of the child package.

Any changes that you make in the local copy of a dependency package will be immediately reflected within the virtualenv of the parent package.

You can then work on all the packages at the same time, using a branch on each package repo with the same name e.g. feature/20240101_feature_name, until the feature is ready. Then you can go through the merge process for each package repo.


I have developed two simple Python packages:

python3-editable-installs-1 imports python3-editable-installs-2.

python3-editable-installs-2 has been released on Github, so there's a tag that can be used for specifying the package version.

I assume that you've aliased python to python3.

Open a terminal.

mkdir editable && cd editable

git clone

git clone

cd python3-editable-installs-1

python -m venv .venv

. .venv/bin/activate

pip install -r requirements.txt

Here's the contents of requirements.txt:

# PyPI imports

# Github imports
python3-editable-installs-2 @ git+

Now if I run pip freeze, I see this output:

(.venv) stjohn@horizon python3-editable-installs-1 % pip freeze
python3-editable-installs-2 @ git+

Note: Although I specified a tag for python3-editable-installs-2 in requirements.txt, the tag is mapped to a commit hash, which is then used.

Ok, now that python3-editable-installs-1 has been set up, we can change python3-editable-installs-2 to be an editable install of the local copy of the package.

pip install --no-deps --editable ../python3-editable-installs-2

We don't need to uninstall it first. The new pip install command will overwrite the existing package.

We use the --no-deps option to prevent pip from changing any dependencies of the target package. This becomes useful in the situation where we are editing 3 packages simultaneously, for example if python3-editable-installs-2 had another child package called python3-editable-installs-3.

Now, run the test (stored in test/

pytest test

This should succeed.

Now, in the local copy of python3-editable-installs-2, open the file editable_installs_2/ and change the value of x from 1 to 2.

Now re-run the test command pytest test. It should fail.


What's happened here ? Well, you've changed the local copy of a dependency, and this change has been reflected immediately in the parent package that imports it.

This means that you can work on both packages simultaneously.

I recommend creating a new branch in each package repo, with the same name e.g. feature/20240101_feature_name. When the feature is ready, go through the merge process for each package repo.

This approach can be extended to 3 or more packages in a chain. Be sure to use the --no-deps option when making each editable install.


  • The PyCharm editor can't follow the editable install links. It will apply a red underline to the name of the editable package in the code. However, it can still run the tests.


Follow Tela Network on LinkedIn:

Follow Tela Network on Twitter:

Join Tela Network and become a consultant:

Join the Tela Social channel on Telegram to get every new update:

Follow Tela Network on Instagram: