一、安装多个包

1.有网的服务器

1.生成requirement.txt文件

pip freeze >/tmp/wheel_pip/requirements.txt

这个命令会把当前环境下面的pip安装包名,都放到文件中

2.打包pip和wheel的whl文件

pip wheel --wheel-dir=/tmp/wheel_pip pip
pip wheel --wheel-dir=/tmp/wheel_pip wheel

如果没有wheel,就pip install wheel安装

3. 打包所有依赖包的whl文件

pip wheel --wheel-dir=/tmp/wheel_pip -r requirements.txt

4.下载get-pip文件

wget https://bootstrap.pypa.io/get-pip.py

5. 添加到压缩包

tar cf /tmp/wheel_pip  wheel_pip.tar

2.离线的服务器

1.解压压缩包

wheel_pip.tar复制到离线的服务器,解压

cd /tmp/ & tar xf wheel_pip.tar ./

2. 安装pip

python get-pip.py --no-index --find-links=/tmp/wheel_pip

3. 安装wheel

pip install --no-index --find-links=/tmp/wheel_pip wheel

4. 安装其他包

pip install --no-index --find-links=/tmp/wheel_pip -r requirements.txt
pip install --no-index --find-links=/data1/upload/wheel_pip -r /data1/upload/wheel_pip/requirements.txt

三、安装单个包

1.有网的服务器打包

pip wheel --wheel-dir=/data1/anchor/lujianxing/  celery
#指定包的版本
pip wheel --wheel-dir=/data1/anchor/lujianxing/ celery==3.1.18

wheel包的地址

ll /data1/anchor/lujianxing/celery-3.1.18-py2.py3-none-any.whl

2.同步文件到正式环境

3. 无网的服务器安装

cd /data1/upload/
pip install celery-3.1.18-py2.py3-none-any.whl

未经许可,请不要转载。

参考

使用Pip在离线环境安装Python依赖库的更多相关文章

  1. 【linux】安装python依赖库confluent_kafka

    想跑https://github.com/ghaughian/mongo-kafka-spark/blob/master/src/pub.py这个程序,发现没有confluent_kafka库 1.p ...

  2. linux7 安装 zlib依赖库 与安装python 3.6

    Linux 安装zlib依赖库 进入src: cd /usr/local/src 下载zlib库: wget http://www.zlib.net/zlib-1.2.11.tar.gz 解压下载的t ...

  3. Eclipse环境安装Python插件PyDev

    转载自:http://blog.csdn.net/typa01_kk/article/details/49251247 clipse环境安装Python插件PyDev 软件准备,下载地址,先看安装,再 ...

  4. 离线安装 python 第三方库

     离线安装 python 第三方库 首先你需要在联网的服务器上已经安装了一个第三方库,比如是paramiko,也就是说你已经执行了 pip install paramiko    ,小提示: 如果在安 ...

  5. 使用pip install 或者easy_install安装Python的各种包出现cc failed with exit status 1

    *:first-child { margin-top: 0 !important; } body > *:last-child { margin-bottom: 0 !important; } ...

  6. 【转】Ubuntu 16 安装 python 依赖出现 error: command 'i686-linux-gnu-gcc' failed with exit status 1

    问题 在 Ubuntu 下安装 python 依赖的时候出现以下错误 build/temp.linux-i686-3.5/_openssl.c:498:30: fatal error: openssl ...

  7. 【Python基础】安装python第三方库

    pip命令行安装(推荐) 打开cmd命令行 安装需要的第三方库如:pip install numpy 在安装python的相关模块和库时,我们一般使用“pip install  模块名”或者“pyth ...

  8. 安装Python算法库

    安装Python算法库 主要包括用NumPy和SciPy来处理数据,用Matplotlib来实现数据可视化.为了适应处理大规模数据的需求,python在此基础上开发了Scikit-Learn机器学习算 ...

  9. Windows下如何安装python第三方库lxml

    lxml是个非常有用的python库,它可以灵活高效地解析xml,与BeautifulSoup.requests结合,是编写爬虫的标准姿势. 参考 Windows下如何安装python第三方库lxml ...

随机推荐

  1. jquery 学习 总结

    OM = Document Object Model(文档对象模型) 一.基础 1.    <script src="http://cdn.static.runoob.com/libs ...

  2. ajax冲刺03

    ---恢复内容开始--- 1.jq中ajax封装 简单的$.ajax方法使用示例:请关注 传参类型及数据 <!DOCTYPE html> <html lang="en&qu ...

  3. Metadata获取的三种方式

    本文的试验环境为CentOS 7.3,Kubernetes集群为1.11.2,安装步骤参见kubeadm安装kubernetes V1.11.1 集群 0. Metadata 每个Pod都有一些信息, ...

  4. docker-mysql-cron-backup不能执行任务

    https://github.com/shiningrise/docker-mysql-cron-backup CRON_TIME=“0 18 * * * ?” 改为 CRON_TIME=0 18 * ...

  5. Python数据预处理:机器学习、人工智能通用技术(1)

    Python数据预处理:机器学习.人工智能通用技术 白宁超  2018年12月24日17:28:26 摘要:大数据技术与我们日常生活越来越紧密,要做大数据,首要解决数据问题.原始数据存在大量不完整.不 ...

  6. iOS 线上版本图片资源格式的问题导致的闪退

    链接:https://www.jianshu.com/p/6492779cb89e來源:简书 导致这种问题的原因是:在 Xcode 8 中,当你资源文件中[含有16位图]或者[图片显示模式γ值为'P3 ...

  7. 树莓派进阶之路 (037) - 设置树莓派3 B+的静态IP

    修改/etc/dhcpcd.conf 文件 sudo vim /etc/dhcpcd.conf interface eth0 static ip_address= static routers=192 ...

  8. 构建自己的 Smart Life 私有云(一)-> 破解涂鸦智能插座

    博客搬迁至https://blog.wangjiegulu.com RSS订阅:https://blog.wangjiegulu.com/feed.xml 原文链接:https://blog.wang ...

  9. CentOS 7.4安装nodejs & nginx & pm2

    一.安装nodejs1.查看操作系统信息 uname -a cat /etc/centos-release 2.安装wget yum install wget -y3.安装nodejs 1.下载 wg ...

  10. 21.翻译系列:Entity Framework 6 Power Tools【EF 6 Code-First系列】

    原文链接:https://www.entityframeworktutorial.net/code-first/entity-framework-power-tools.aspx 大家好,这里就是EF ...