离线 wheelhouse
如果你确实必须在 B 环境装依赖,但 B 环境不具备访问pypi的网络,那就只能走离线包:
在 A 环境/部署机(能访问 pypi 的机器):
bash
python -m pip download -r requirements.txt -d wheelhouse \
-i https://xxx.xxx.org/simple/ --trusted-host xxx.xxx.org
把 wheelhouse/ 拷贝到 B,然后在 B 环境:
bash
python -m pip install --no-index --find-links wheelhouse -r requirements.txt