包括.whl安装在requirements.tx中

2024-05-23 18:11:18 发布

您现在位置:Python中文网/ 问答频道 /正文

如何将其包含在requirements.txt文件中? 对于Linux:

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

对于MacOS:

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

Tags: installpiporgtxtnonehttppost2download
1条回答
网友
1楼 · 发布于 2024-05-23 18:11:18

您可以使用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

(两个Linux条目:Python 2的linux2,Python 3的linux。)

相关问题 更多 >