Can I have an editable entry in my requirements.txt?

Viewed 98

I have an environment which I previously installed into an editable package:

virtualenv venv
. venv/bin/activate
pip install -e ...
pip freeze | grep <pkg_name>

-e git+ssh://git@bitbucket.org/SPACE/REPO.git@HASH#egg=NAME&subdirectory=PATH

I copeid the pip freeze result to a req.txt file and installed it into a new environment, and it works.

My question is - how can I make it pull the code to build and install, not from a remote server, but from my local project (like done when running pip install -e)

It would obviously only work on my machine, assuming that project still is there, but this is what I want...

1 Answers

According to pip documentation (1, 2), yes, you can have an entry like this in your requirements.txt:

-e git+ssh://git@example.com/repo.git

Also as chepner has pointed out, one could just specify local URL:

-e file:///home/someone/repo
-e file://C:\Users\someone\repo
Related