python 本地l离线安装whl文件
记录下无网络时安装Python环境
一: 单独下载文件
1、下载whl离线文件到本地,放到c盘根目录(任意位置均可,只是方便安装)
https://pypi.org/
https://www.lfd.uci.edu/~gohlke/pythonlibs/(国内源,速度快。ctrl+f找到自己需要的文件)
2、 cmd到存放whl文件的目录
3、pip安装whl离线文件
pip install ****.whl
(****.whl是我们下载的whl的文件名称)
二、批量下载(使用requirements.txt文件,适用于公司为内网环境,可以先从外网下载,再拷贝到内网安装)
1、pip freeze > requirements.txt
2、配置pip(pip安装速度快的可以忽略这一步)
①在C:\Users\<你的电脑用户名>\ 新建一个文件夹 pip
②在新建的pip目录新建一个 pip.ini 文件,内容如下
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
extra-index-url = https://pypi.douban.com/simple/
timeout = 120
3、(请注意cmd当前路径需包含requirements.txt文件)
先使用如下命令将包下载到本地(两条命令都需要执行,第二条命令是对第一条命令的补充),此次是下载到dir目录中
pip wheel -w DIR -r requirements.txt
pip download -d DIR -r requirements.txt
pip download --dest ./lib_data --no-deps --platform=manylinux2014_x86_64 --only-binary=:all: tensorflow
再将requirements.txt和dir目录拷贝到离线环境,再使用这条命令安装即可
pip install --no-index --find-links=DIR -r requirements.txt
如果给 pip download 命令添加选项 --platform、 --python-version、 --implementation 和 --abi 可以用于获取解释器和系统的依赖关系,而不是运行 pip 的解释器和系统的依赖关系,当添加了这些选项时,也必须同时添加 --only-binary=:all: 或 --no-deps
pip download 和 pip wheel 的区别
I'm also curious about this question and the official doc is really ambiguous.
First, with my experiment, the two commands you provided will produce the same output, and the process is quite similar.
But after I read the official doc carefully, I find some options of these two commands is different.
for
pip download, this command is focus on download packages from somewhere, even it will also try to built it, but it will fallback to download the source packge if it can't built it. There are some options for you to filter the packages you want to download, even the packages is not compatible with your current environment. like--platform,--python-version,--implementation, so you can download packges for whatever interpreter you want.for
pip wheel, this command is focus on build a wheel for package and it's dependencies. It provide an optio--build-option, let you custom the built process. So, with this command you can only download the packages that compatible with your current interpreter and platform.
In my opinion, pip wheel is more like pip install than pip download, cause it can only "download" the packages with current interpreter.
Now for your questions:
- Are then the two commands equivalent? (In this case this would look like replication of instructions, not really a good design principle uncle Guido!)
Ans: For packges compatible with current interpreter, yes, they are almost equivalent, except you want some built options.
- How can I achieve my goal of obtaining the whls required out of my python environment and ignoring any internet 'index's?
Ans: Both command can download from local index or a local directory, but if you want packages for other platform, pip download is needed. In your situation, you may create your own index or a directory holds all packages you needed and install from there every time.
Expect more precise answers.
python 本地l离线安装whl文件的更多相关文章
- 吴裕雄--天生自然 python开发学习笔记:下载python离线安装whl文件链接
https://www.lfd.uci.edu/~gohlke/pythonlibs/
- windows7下怎样安装whl文件(python)
本文转载自:http://blog.csdn.net/fhl812432059/article/details/51745226 windows7 python2.7 1.用管理员方式打开cmd 2. ...
- Windows10:怎么安装whl文件
whl格式本质上是一个压缩包,里面包含了py文件,以及经过编译的pyd文件.使得可以在不具备编译环境的情况下,选择合适自己的python环境进行安装.安装方法很简单,进入命令行输入pip instal ...
- python安装whl文件的注意事项(windows系统)
首先给大家来一波福利,在没有连接外网(互联网)的情况下,只有公司内网或者断网情况下,需要安装python的一些依赖,不会操作的同学可能就会遇到麻烦.这里教大家离线安装python依赖. 方法:使用.w ...
- python 安装whl文件
对于安装whl格式的文件,首先要安装wheel包 利用 pip install wheel或下载再安装: 下载地址: https://pypi.python.org/pypi/wheel 解压后安装: ...
- python中的各个包的安装,用pip安装whl文件
在安装之前,一直比较迷惑究竟如何用,安装完后,发现竟然如此简单 首先我一般用的是python27,官网下载python27msi安装window7 64位后,已经自带了Pip 和 easy_insta ...
- python使用pip离线安装库
一.前言及环境 1. 场景及整体思路 最近在做一个大数据项目,开发过程中用自己的机子安装了很多库,开发完之后需要部署到客户那边的环境中,但是客户那边的环境是不能联网的,于是就需要离线进行库的安装. 上 ...
- Windows 10通过本地镜像离线安装.NET 3.5
在Windows10中,当我们安装某些软件的时候会提示"你的电脑上的应用需要使用以下Windows功能:.NET Framework 3.5(包括.NET 2.0和3.0)",由于 ...
- python安装whl文件
在命令指示符下(cmd)的Python3安装命令为: pip3 install 文件名.whl 安装出错: matplotlib-2.0.0-cp34-cp34m-win_amd64.whl is n ...
- windows下python3.5使用pip离线安装whl包
0. 绪论 Windows离线断网环境下安装Python包,配置环境,准备用来生成word模版.姑且记录一下 生产环境 : windows 7 windows10 python 3.5.2 pip 1 ...
随机推荐
- RxJava2.x的理解与总结
RxJava2.x的理解与总结 RxJava是一个基于观察者设计模式将链式编程和异步结合在一起的开源库. 链式编程 通过查看GitHub开源项目的简介开源知道,RxJava有几个基类. 他们分别适用于 ...
- 一、100ASK_IMX6ULL嵌入式裸板学习_LED实验(上)
LED实验 汇编的方式驱动LED /* *LED汇编实验 *创建者:Orange *2021年03月04日 */ .global _start @全局标号 _start: /*使能所有外设时钟 */ ...
- BlendCAC: A Smart Contract Enabled Decentralized Capability-Based Access Control Mechanism for the IoT
摘要 BlendCAC,它是一种分散的.基于联合能力的 AC 机制,可有效保护大规模物联网系统中的设备.服务和信息.引入了基于联合能力的委托模型 (FCDM) 以支持分层和多跳委托.探索了委托授权和撤 ...
- OS-lab6
OS-lab6 管道 在lab5的时候我们实现了文件类设备的读写操作,而在fd.c中,我们定义了3种设备:文件类设备.管道.终端,其中终端已经被完成了,剩下的就是管道了. 管道是一种父子进程间通信的设 ...
- OS-lab1
OS-lab1 boot boot文件夹中只有start.S文件,这个文件用于初始化内核.关掉中断,设置内核栈,并跳转到main函数. init init.c 执行初始化操作. main.c 主函数, ...
- 如何用python将txt中的package批量安装
第一步:cd 到目标路径 第二步:新建一个requirement.txt文档,将所有要下载的包一一罗列出来(需要指定版本的话,可以用==表明) 第三步:输入命令 pip install -r req ...
- [转]如何将本地项目上传至Gitee仓库(详细教程)
码云(Gitee)简单介绍 Git 是一个开源的分布式版本控制系统,用于敏捷高效地处理任何或小或大的项目. Git 是 Linus Torvalds 为了帮助管理 Linux 内核开发而开发的一个开放 ...
- git技能树总结
1. git简介 版本控制: 指的是一种记录一个或若干文件内容变化,以便将来查阅特定版本修订情况的系统.版本控制系统发展可分三个阶段:本地版本控制系统 -> 集中式版本控制系统 -> 分布 ...
- 读后笔记 -- Python 全栈测试开发 Chapter8:接口测试
8.1 接口测试 1. 市场分布 UI(web.app)自动化:10% 接口自动化:20% 单元测试:70% -- 测开 2. 接口类型: 1)结构划分:模块间(系统间)的接口称为内部接口:系统与第三 ...
- -bash: nslookup: 未找到命令;centos7 安装nslookup
一.安装服务 [root@localhost ~]# yum -y install bind-utils 二.查看 [root@localhost ~]# nslookup