Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Include .whl installation in requirements.txt

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 
like image 417
Abhishek Bhatia Avatar asked Jul 10 '17 17:07

Abhishek Bhatia


People also ask

How do I install Visual Studio code requirements txt?

With your chosen environment selected using the Python: Select Interpreter command, run the Terminal: Create New Terminal command (Ctrl+Shift+`)) to open a terminal with that environment activated. In the terminal, run pip freeze > requirements. txt to create the requirements. txt file in your project folder.


1 Answers

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.)

like image 177
Chris Warrick Avatar answered Oct 18 '22 01:10

Chris Warrick