Brandon Rozek

Photo of Brandon Rozek

PhD Student @ RPI studying Automated Reasoning in AI and Linux Enthusiast.

Pip Editable

Published on

Updated on

Warning: This post has not been modified for over 2 years. For technical posts, make sure that it is still relevant.

I’ve found it to be incredibly helpful to emulate having a library installed on my system rather than depending on my local directory path to pick up my file edits. To do this in a python project, we need to add the --editable flag to a pip install.

First uninstall whatever version of your library you have.

pip uninstall library

Then in your folder with the setup.py run the following command

pip install --editable .

This will then create a symlink from your site-packages directory to the directory in which your code lives.

Once you’re ready to install it formally,

pip uninstall library
pip install .

Distribute it,

pip wheel .
Reply via Email Buy me a Coffee
Was this useful? Feel free to share: Hacker News Reddit Twitter

Published a response to this? :