[以前笔记](https://www.cnblogs.com/wangxue533/p/11165767.html)的升级/简洁版
0. 将Win/本地项目的依赖包导出到requirement.txt文档
```sh
pip3 freeze > requirements.txt
```
0.1. 配置pypi私服地址及超时时间
```
pip install -i http://128.196.x.xx:xxxx/repository/Pypixxx/simple/ --trusted-host 128.196.x.xxx(公司私有Pipy库地址) pip==22.0.4 -U
pip config set global.index-url http://128.196.x.xx:xxxx/repository/Pypixxx/simple/
pip config set global.timeout 6000
```
0.2. 配置信任主机
```
pip config set install.trusted-host 128.196.x.xxx
pip config list
```
1. 在能连上私有Pypi镜像/外网的机器上,将requirement.txt文档中列出的模块信息下载到指定目录,以便于拷贝、安装在多台离线的内网Linux机器上
```sh
pip3 download -r requirements.txt -d /xxx(你要保存python三方库的地址)/ReliablePackage/ --trusted-host 128.196.x.xxx(公司私有Pipy库)
```
2. 一口气把本地大量已下载的三方库安装好
```sh
pip3 install --no-index --find-links=d:\python27\packages(win下,linux下记得多加一个/,到文件夹下) -r requirements.txt
```
# 参考链接
* 之前写在博客园的,忘记搬到csdn了
* Python离线安装三方库_在公司是内网,有私有Pypi镜像的情况下 - 罗生堂下 - 博客园