Include .whl installation in requirements.txt

Abhishek Bhatia picture Abhishek Bhatia · Jul 10, 2017 · Viewed 9.4k times · Source

How do I include this in the requirements.txt file? For Linux:

pip install http://download.pytorch.org/whl/cu75/torch-0.1.12.post2-cp27-none-linux_x86_64.whl 
pip install torchvision

FOR MacOS:

pip install http://download.pytorch.org/whl/torch-0.1.12.post2-cp27-none-macosx_10_7_x86_64.whl 
pip install torchvision 

Answer

Chris Warrick picture Chris Warrick · Jul 10, 2017

You can use environment markers:

http://download.pytorch.org/whl/cu75/torch-0.1.12.post2-cp27-none-linux_x86_64.whl ; sys_platform == "linux"
http://download.pytorch.org/whl/cu75/torch-0.1.12.post2-cp27-none-linux_x86_64.whl ; sys_platform == "linux2"
http://download.pytorch.org/whl/torch-0.1.12.post2-cp27-none-macosx_10_7_x86_64.whl ; sys_platform == "darwin"
torchvision

(Double Linux entries: linux2 for Python 2, linux for Python 3.)