一、导出包名和版本
// 将已安装的包名和版本号写入requirements.txt文件中
(env001) C:\Users\test>pip3 freeze > requirements.txt
导出结果如下:
altgraph==0.17
attrs==20.2.0
Automat==20.2.0
bcrypt==3.1.7
cffi==1.14.0
click==7.1.2
constantly==15.1.0
cryptography==2.9.2
cssselect==1.1.0
et-xmlfile==1.0.1
future==0.18.2
二、根据导出结果下载相关包及依赖
需要注意包及requirements.txt文件所在目录
// 根据导出结果下载相关包及依赖
命令格式:pip3 download -d [保存目录] -r [导出结果文件]
(env001) F:\Downloads\pipinstaller_20210411>pip3 download -d .\ -r requirements.txt
三、离线安装上述包
需要注意包及requirements.txt文件所在目录
// 根据导出结果下载相关包及依赖
命令格式:pip3 install -r [导出结果文件]
(env001) F:\Downloads\pipinstaller_20210411>pip3 install -r requirements.txt