Search code examples
pythonpip

What is the use of `pip install -e .` if I can simply run the python script using the environment?


Based on this answer, I can fully understand the use of:

pip install -e /path/to/locations/repo

However, I am yet to see the use of:

pip install -e .

I can understand it from the perspective of doing pip install -e /path/to/locations/repo, but from the working directory of the project dependency. But that's the only use case I can see.

In what use case would I want to install locally the same package I am now working on?


Solution

  • pip install -e
    

    will just create a projekt_name.egg-info file in the venv\Lib\site-packages folder with a link to the repo location. Nothing is copied.

    You can continue developing and you can access your project packages as if the repo was properly installed. No dirty sys.path.append-hacks needed.