使用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 ...
随机推荐
- 编程菜鸟的日记-初学尝试编程-编写函数实现strcpy功能(总结考察点)
char *Mystrcpy(char *strDest, const char *strSrc) //考察点1:将源字符串加const,表明为输入参数 {//考察点2:对源地址和目的地址的非0断言 ...
- WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: <NSInvalidArgumentException> -[__NSArrayM objectForKey:]: unrecognized s
<!DOCTYPE html> <html> <head> <title></title> <meta http-equiv=&quo ...
- keras用vgg16做图像分类
实际上我只是提供一个模版而已,代码应该很容易看得懂,label是存在一个csv里面的,图片是在一个文件夹里面的 没GPU的就不用尝试了,训练一次要很久很久... ## import libaries ...
- Codeforces Round #539 (Div. 2)
Codeforces Round #539 (Div. 2) A - Sasha and His Trip #include<bits/stdc++.h> #include<iost ...
- MyEclipse 2015 SVN 安装
SVN的在线安装 1.打开MyEclipse,找到顶部菜单栏 Help(帮助)-Install from Site…(从网站安装),如下图 2. 点击Install from Site…后会出现让你选 ...
- Ubuntu远程连接MySQL(connection refused)解决方法
一.判断ubuntu是否开启防火墙 sudo ufw status 开放防火墙3306端口 sudo ufw allow 3306 二.查看3306端口是否打开 注意:红色框框表示3306绑定的ip ...
- 如何将excel 数据库表结构生成powerdesign物理模型
Option Explicit Dim mdl ' the current model Set mdl = ActiveModel If (mdl Is Nothing) Then MsgBox &q ...
- C# Monitor实现
Monitor的code如下,非常简单: public static class Monitor { public static extern void Enter(Object obj); publ ...
- Android:android studio快捷键大全
一.常用快捷键 1.Ctrl+E,可以显示最近编辑的文件列表 2.Shift+Click可以关闭文件 3.Ctrl+[或]可以跳到大括号的开头结尾 4.Ctrl+Shift+Backspace可以跳转 ...
- jqeury-地区三级联动
html+js <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www ...