美文网首页
使用pip离线安装Python包

使用pip离线安装Python包

作者: Jiafu | 来源:发表于2018-04-17 15:00 被阅读0次

公司开发环境没有联网,安装一些Python包时非常麻烦,尤其是依赖包一多的时候。搜索一下使用pip离线安装Python安装包的方法,方法如下。

pip的安装这里忽略,以下的步骤假设已经安装好pip了。

  1. 找到一个能联网的机器,下载依赖包:
# cd /tmp

# mkdir pandas

# pip install --download /tmp/pandas pandas

# tar zcvf pandas.tar.gz /tmp/pandas
  1. 将打包好的文件上传到目标服务器使用pip安装即可:
# cd /tmp

# tar zxvf pandas.tar.gz

# pip install --no-index --find-links=/tmp/pandas pandas

相关文章

网友评论

      本文标题:使用pip离线安装Python包

      本文链接:https://www.haomeiwen.com/subject/ohtpkftx.html