python项目为什么有requirements.txt文件?
使用目的:任何应用程序通常需要设置安装所需并依赖一组类库来满足工作要求。要求文件是指定和一次性安装包的依赖项具体一整套方法。
requirements.txt文件格式:
格式一:直接指定库
# These must be installed before building mmdetection
torch>=1.3
pycocotools
matplotlib
mmcv==0.5.6
numpy
# need older pillow until torchvision is fixed
Pillow<=6.2.2
six
terminaltables
torch>=1.3
torchvision
albumentations==0.4.6
Shapely
tqdm
格式二:间接指定库(=指定文件)
-r requirements/build.txt
-r requirements/optional.txt
-r requirements/runtime.txt
-r requirements/tests.txt
生成
requirements.txt:
pip freeze > requirments.txt
# 整个环境
标签:疑惑,文件,requirements,torchvision,代码,指定,pip,txt From: https://www.cnblogs.com/alexanders/p/18104058
安装
requirements.txt中库:
pip intall -r requirements.txt [-i
https://pypi.douban.com/simple]