使用Pip在离线环境安装Python依赖库
一、安装多个包
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依赖库的更多相关文章
- 【linux】安装python依赖库confluent_kafka
想跑https://github.com/ghaughian/mongo-kafka-spark/blob/master/src/pub.py这个程序,发现没有confluent_kafka库 1.p ...
- 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 ...
- Eclipse环境安装Python插件PyDev
转载自:http://blog.csdn.net/typa01_kk/article/details/49251247 clipse环境安装Python插件PyDev 软件准备,下载地址,先看安装,再 ...
- 离线安装 python 第三方库
离线安装 python 第三方库 首先你需要在联网的服务器上已经安装了一个第三方库,比如是paramiko,也就是说你已经执行了 pip install paramiko ,小提示: 如果在安 ...
- 使用pip install 或者easy_install安装Python的各种包出现cc failed with exit status 1
*:first-child { margin-top: 0 !important; } body > *:last-child { margin-bottom: 0 !important; } ...
- 【转】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 ...
- 【Python基础】安装python第三方库
pip命令行安装(推荐) 打开cmd命令行 安装需要的第三方库如:pip install numpy 在安装python的相关模块和库时,我们一般使用“pip install 模块名”或者“pyth ...
- 安装Python算法库
安装Python算法库 主要包括用NumPy和SciPy来处理数据,用Matplotlib来实现数据可视化.为了适应处理大规模数据的需求,python在此基础上开发了Scikit-Learn机器学习算 ...
- Windows下如何安装python第三方库lxml
lxml是个非常有用的python库,它可以灵活高效地解析xml,与BeautifulSoup.requests结合,是编写爬虫的标准姿势. 参考 Windows下如何安装python第三方库lxml ...
随机推荐
- Java 多线程 高可用原则
高可用原则 1 降级 降级开关的设计思路如下: 1. 集中管理开关:把开关推送到各个应用. 2. 可降级的多级读服务:比如服务调用降级为只读本地缓存.只读分布式缓存.只读默认降级数据(如库存状态默认有 ...
- H5C301
标题H5C301 1.html5 h5最新版本.所有主流浏览器都支持h5.但仅ie9及以上支持h5 改变了用户与文档的交互方式:多媒体 新增了其他的特性:语义,本地存储,网页多媒体 抛弃了不合理的标签 ...
- java获得上下周及本周日期
public static SimpleDateFormat getFormat(String format) { return new SimpleDateFormat(format); } /** ...
- Android SDK版本号 与 API Level 对应关系
转自:https://blog.csdn.net/qiaoquan3/article/details/70185550 Android SDK版本号 与 API Level 对应关系 新接触And ...
- MAC 开启与关闭SIP
1. 查看SIP状态 在终端中输入csrutil status,就可以看到是enabled还是disabled. 2. 关闭SIP S1 重启MAC,按住cmd+R直到屏幕上出现苹果的标志和进度条, ...
- 如何使用HttpClient包实现JAVA发起HTTP请求?
今天在搭建公司项目框架的时候,发现缺少了一个Java发送HTTP请求的工具类,在网上找了一通,经过自己的改造,已经能实现get请求和post请求的了,现在将代码贴在这里.给大家参考. 1 packag ...
- 【不做标题党,只做纯干货】HashMap在jdk1.7和1.8中的实现
同步首发:http://www.yuanrengu.com/index.php/20181106.html Java集合类的源码是深入学习Java非常好的素材,源码里很多优雅的写法和思路,会让人叹为 ...
- std::vector push_back报错Access violation
C/C++ code ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 #include < ...
- 树莓派raspberry pi配置无线路由器AP
raspi-config进入系统配置面板 进行 Expand Filesystem 扩展文件系统否则备份系统的时候备份文件会急速膨胀. (1)配置网络环境nano /etc/network/inte ...
- 使用MiniProfiler调试ASP.NET web api项目性能
本质上,集成Miniprofiler可以分解为三个问题: 怎样监测一个WebApi项目的性能. 将性能分析监测信息从后端发送到UI. 在UI显示分析监测结果. 首先安装Miniprofiler,Min ...