python3离线安装命令

1. 从A机器上将某个模块打包成安装包
$pip3 download arrow  -d /tmp/packages/
1
2. 从A机器上将全部python环境打包
$pip3 freeze >requirements.txt # 查询安装模块
$pip3 download -r requirements.txt -d /tmp/packages/   # 推荐使用
或者:
$pip3 install --download /tmp/packages -r requirements.txt
1
2
3
4
3. 在B机器上安装某个模块
$pip install arrow-0.10.0.tar.gz   # 从A机器拷贝的文件
或者:
$tar -xvf arrow-0.10.0.tar.gz
$cd arrow-0.10.0
$python setup.py install
1
2
3
4
5
4.在B机器上复制A机器python环境
$pip install –no-index –find-links=/root/packages -r requirements.txt # 拷贝过来的文件
--------------------- 
作者:GiveMeFive_Y 
来源:CSDN 
原文:https://blog.csdn.net/GiveMeFive_Y/article/details/79473671 
版权声明:本文为博主原创文章,转载请附上博文链接!

猜你喜欢

转载自blog.csdn.net/mezheng/article/details/83177779