一、安装多个包

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. SparkStreaming “Could not read data from write ahead log record” 报错分析解决

    # if open wal org.apache.spark.SparkException: Could not read data from write ahead log record FileB ...

  2. 使用 vscode + chrome debuger断点调试 Vue 程序

    总体参考:https://cn.vuejs.org/v2/cookbook/debugging-in-vscode.html 注意点: 1.修改 source-map 2.设置 webRoot 的路径 ...

  3. FPGA基础之逻辑单元(LE or LC)的基本结构

    原帖地址: https://blog.csdn.net/a8039974/article/details/51706906/ 逻辑单元在FPGA器件内部,是完成用户逻辑的最小单元.逻辑单元在ALTER ...

  4. linux下rocksdb的编译安装

    RocksDB起源于Facebook的实验室项目,实现了一个高性能的快速存储器,是基于C++编写的key value数据库,很多软件都是采用内置rocksdb的方式运行,所以需要我们提前安装rocks ...

  5. windows10开启wst子系统

    需求描述: 在玩docker发现需要linux运行玩转,直接在vmware虚拟机上跑 ,性能有损耗.想直接在windows下运行docker 问题解决: windows10的wst子系统可以安装lin ...

  6. python两个 list 获取交集,并集,差集的方法

    1. 获取两个list 的交集 #方法一: a=[2,3,4,5] b=[2,5,8] tmp = [val for val in a if val in b] print tmp #[2, 5] # ...

  7. Python之数学题目练习

    首先,下面的题目来自我的大学同学的分享,他用数学证明,我用编程计算机发现了答案. 他的数学推理: 然后下面是我的Python代码: #coding=utf-8 # 井的高度 well_hegith = ...

  8. Effective Java 第三版—— 87. 考虑使用自定义序列化形式

    Tips 书中的源代码地址:https://github.com/jbloch/effective-java-3e-source-code 注意,书中的有些代码里方法是基于Java 9 API中的,所 ...

  9. Effective Java 第三版——81. 优先使用并发实用程序替代wait和notify

    Tips 书中的源代码地址:https://github.com/jbloch/effective-java-3e-source-code 注意,书中的有些代码里方法是基于Java 9 API中的,所 ...

  10. 15.翻译系列:EF 6中的级联删除【EF 6 Code-First 系列】

    原文链接:https://www.entityframeworktutorial.net/code-first/cascade-delete-in-code-first.aspx EF 6 Code- ...