首页 > 其他分享 >学习过程中,项目文件、代码疑惑点

学习过程中,项目文件、代码疑惑点

时间:2024-03-29 16:25:23浏览次数:25  
标签:疑惑 文件 requirements torchvision 代码 指定 pip txt

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.txt中库:
pip intall -r requirements.txt [-i https://pypi.douban.com/simple]

标签:疑惑,文件,requirements,torchvision,代码,指定,pip,txt
From: https://www.cnblogs.com/alexanders/p/18104058

相关文章