1.制作requirement.txt
pip freeze > requirement.txt
内网安装外部依赖包办法:
例如:安装pytest包得时候会顺带安装pytest依赖包
离线下载安装包
下载单个离线包 - pip download -d your_offline_packages
批量下载离线包 - pip download -d your_offline_packages -r requirements.txt
离线安装
安装单个离线包 - pip install --no-index --find-links=/your_offline_packages/ package_name
批量安装离线包 - pip install --no-index --find-links=/your_offline_packages/ -r requirements.txt
批量安装:
requirements文件内容: