pip离线安装方法

python在线打包和离线安装

  1. 将软件包名称和版本写入requirements.txt
    #格式:

cat requirements.txt
PyMySQL==0.7.11
wheel==0.29.0
mysql-replication==0.13

  1. 下载requirements.txt中的软件包

pip download -d tmp -r requirements.txt

3.在没有网络的环境安装python软件包
#有多个文件的情况下,需要指定多个文件

pip install --no-index --find-links=./tmp/PyMySQL-0.7.11-py2.py3-none-any.whl
–find-links=./tmp/wheel-0.29.0-py2.py3-none-any.whl
–find-links=./tmp/mysql-replication-0.13.tar.gz -r requirements.txt

猜你喜欢

转载自blog.csdn.net/u011659193/article/details/83783975