4

I'm trying to write a script that uses mkvirtualenv to re-make a virtual environment from the requirements recorded earlier with pip freeze > <req_file>. The original environment includes some editable installs (setuptools develop mode installs) installed with pip install -e <path>, but you could not tell from correspending requirements which look like <package>==<version>.

When I run mkvirtualenv -r <req_file>, it passes the requirements file to pip -r. But pip fails because it is unable to find distributions for the editable installs.

How can I configure pip to know about the list of the paths originally specified to pip -e and use these development eggs to fulfill requirements? I tried find-links in pip.conf (and extra-search-dir in virtualenv.ini) without success.

maf
  • 305
  • 1
  • 9
  • In `pip.FrozenRequirement.from_dist`, only editable installs from a VCS (e.g. `git+file:#egg=`) are accepted and will produce an `-e`-entry in the requirements file. But theses installs create a clone of the repository, so changes to the original source are not reflected. What I want is a non-VCS install during development. – maf Feb 12 '18 at 18:58

1 Answers1

3

You can use -r in requirements files as well:

-e git+<Git-URL>

https://pip.readthedocs.io/en/1.1/requirements.html

Maaaaa
  • 388
  • 2
  • 16
  • 1
    Thanks, that's true. But the requirement files are created by another script (which executes `pip freeze`) and I wouldn't want to have to edit them manually. And I haven't found an option for `pip freeze` to output more suitable requirements. – maf Feb 12 '18 at 11:01