How can I specify a local git repo as a dependency in requirements.txt so that I can install it with pip install -r requirements.txt
? The issue is not that I am unable to install or clone from that location, but how to escape the spaces in the path to the repo directory in the requirements.txt. To be completely clear, both cloning and pip installing work by enclosing the path in "
, it only fails with pip install -r
.
I have tried
git+"K:/my/path with/lots of/spaces/repo/.git"
git+git://"K:/my/path with/lots of/spaces/repo/.git"
git+git:"//K:/my/path with/lots of/spaces/repo/.git"
git+"git://K:/my/path with/lots of/spaces/repo/.git"
"K:/my/path with/lots of/spaces/repo/.git"
git+file://K:/my/path\ with/lots\ of/spaces/repo/.git
But in every case I receive the error ValueError: No closing quotation
.
If I try to escape the spaces with \
it is interpreted as a Windows Path separator and fails.
EDIT:
So the following works:
pip install git+file:///"k/my/path with/lots of/spaces/repo/.git/"
However, when I put the exact same thing into my requirements.txt
(without pip install
, of course), I get the ValueError: No closing quotation
. Any ideas on how to solve this would be highly appreciated. Is it something I should open an issue with pip for?