下载python离线安装包,在无网络机器安装方法
一、在有网环境先下载离线包
下载 requests 包(wheel 格式或源码 tar.gz)
pip download requests -d ./packages -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple some-package
二、离线安装
将下载好的导入无网络机器上,进入其路径下
pip install --no-index --find-links=. requests
说明:
–no-index 禁止从 PyPI 在线下载。
–find-links=. 指定只从当前目录找包。
这样会把 requests 及其依赖都安装上。