python的pip离线依赖包下载安装

如果你需要在没有网络连接的情况下下载Python的依赖包并进行离线安装

一 进入cmd命令行打包

1 打包单个模块

pip download pytest -d /tmp

2 打包本机所有的包

pip freeze >requirements.txt
pip download -r requirements.txt -d ./tmp

二 批量安装已经导出的包

pip install --no-index --find-links=./tmp -r .\requirements.txt

猜你喜欢

转载自blog.csdn.net/dreams_dream/article/details/131845586
今日推荐