6

How can I add the pip install torch_nightly -f https://download.pytorch.org/whl/nightly/cu90/torch_nightly.html to a requirements.txt?

I tried setting the version to the link as well as just adding the link and both are apparently incorrect

Edit: Won't let me add any more comments, but yeah I was trying to use the requirements file for a virtualenvwrapper environment. Wanted to pip3.6 freeze and copy over my brew python3.6 libs to a virtual env.

Austin
  • 6,921
  • 12
  • 73
  • 138
  • `-f https://download.pytorch.org/whl/nightly/cu90/torch_nightly.html`? Requirements files can persist all arguments that can be passed to `pip install`. – hoefling Oct 13 '18 at 21:00
  • I don't understand how to add it to a requirements list. For example the line `torch-nightly==https://download.pytorch.org/whl/nightly/cu90/torch_nightly.html` didn't work – Austin Oct 13 '18 at 21:01
  • `echo "torch_nightly -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html" > reqs && pip install -r reqs`? Cut everything after `pip install` and write it to reqs file. – hoefling Oct 13 '18 at 21:06
  • Doesn't seem to work for me. `Could not find a version that satisfies the requirement torch_nightly (from -r reqs (line 1)) (from versions: ) No matching distribution found for torch_nightly (from -r reqs (line 1))`. However if I do `pip install torch_nightly -f https://download.pytorch.org/whl/nightly/cu90/torch_nightly.html` directly in terminal it works – Austin Oct 13 '18 at 21:09
  • 1
    Doesn't work for me either; looks like `-f` in requirements files is ignored. – hoefling Oct 13 '18 at 21:19
  • Yup, wondering if there's any alternative syntax in this context. Can't find anything googling so far – Austin Oct 13 '18 at 21:19
  • How about adding the link in `pip.conf`? `echo -e "[install]\nfind-links=https://download.pytorch.org/whl/nightly/cu90/torch_nightly.html" >> $HOME/.pip/pip.conf`, but this will work for system `pip` only. If you have a virtual environment, beware that it ignores the global `pip.conf`, you need to repeat the command, but echoing to `path/to/yourenv/pip.conf` instead. – hoefling Oct 13 '18 at 21:29
  • Also, the drawback of setting `find-links` in `pip.conf` is that it will be applied when installing any package, not just `torch_nightly`; however, since the link only offers `torch_nightly` package, this shouldn't have any side effects. – hoefling Oct 13 '18 at 21:32
  • 1
    You need to have an upgraded pip for this to work: `pip install pip --upgrade` – Doug Blank Oct 20 '18 at 16:08

0 Answers0