Python 离线工作环境搭建的方法步骤
作者:一只小小的寄居蟹 时间:2023-08-30 01:59:21
准备
在断网的和联网的机器安装pip,下载地址https://pypi.python.org/pypi/pip
在联网的开发机器上安装好需要的包
例如:
pip3 install paramiko
pip3 install fabric
打包已安装的包
新建pyenv文件夹用来存储下载下来的所需安装包
pip3 list #查看安装的包
#使用pip导出当前环境所有依赖包信息文件
pip3 freeze >requirements.txt
# 下载所有依赖包到本地
pip3 install -r requirements.txt -d /root/pyenv/
# pip10使用
pip download -d C:\Users\pyenv -r requirements.txt
在其他环境下(相同的系统环境)安装所有依赖
$ pip install --no-index --find-links=/home/pyenv -r requirements.txt
Collecting asn1crypto==0.24.0 (from -r requirements.txt (line 1))
Collecting bcrypt==3.1.4 (from -r requirements.txt (line 2))
Collecting certifi==2018.4.16 (from -r requirements.txt (line 3))
Collecting cffi==1.11.5 (from -r requirements.txt (line 4))
Collecting chardet==3.0.4 (from -r requirements.txt (line 5))
Collecting cryptography==2.2.2 (from -r requirements.txt (line 6))
Requirement already satisfied: fabric==2.0.1 in /home/ap/tscms/anaconda3/lib/python3.6/site-packages/fabric-2.0.1-py3.6.egg (from -r requirements.txt (line 7))
查看已经安装的包
pip freeze
来源:https://www.cnblogs.com/xiao-apple36/p/9055934.html
标签:Python,离线,搭建
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
SQL Server 2005 FOR XML嵌套查询使用详解
2009-01-06 11:20:00
Python进行文件处理的示例详解
2021-12-08 10:51:04
Python实现二分法查找及优化的示例详解
2023-10-12 14:20:44
![](https://img.aspxhome.com/file/2023/4/85374_0s.png)
Python深入06——python的内存管理详解
2021-07-29 05:18:26
![](https://img.aspxhome.com/file/2023/2/87682_0s.jpg)
JavaScript语法约定和程序调试原理解析
2024-04-18 09:46:22
![](https://img.aspxhome.com/file/2023/6/136276_0s.png)
算法系列15天速成 第九天 队列
2022-06-29 14:16:43
![](https://img.aspxhome.com/file/2023/6/120506_0s.png)
django admin组件使用方法详解
2021-05-28 19:59:53
详解SQL Server中的事务与锁问题
2024-01-12 16:26:12
![](https://img.aspxhome.com/file/2023/7/104087_0s.jpg)
Go的固定时长定时器和周期性时长定时器
2023-06-27 12:44:23
PHP implode()函数用法讲解
2023-06-19 22:54:34
![](https://img.aspxhome.com/file/2023/1/55381_0s.png)
使用SQL语句,查第10-20条记录
2008-02-19 18:34:00
20行python代码的入门级小游戏的详解
2023-07-15 01:25:31
将一个图片以二进制值的形式存入Xml文件中
2008-09-04 11:24:00
SQL2005 学习笔记 窗口函数(OVER)
2024-01-27 09:50:49
详解git reset 加不加 --hard的区别
2022-04-03 06:45:13
![](https://img.aspxhome.com/file/2023/5/132455_0s.png)
什么是好的设计
2010-02-25 12:22:00
php生成curl命令行的方法
2023-07-23 22:19:42
matplotlib绘制多个子图(subplot)的方法
2023-01-17 08:27:45
Python中顺序表的实现简单代码分享
2022-08-31 22:26:36
![](https://img.aspxhome.com/file/2023/1/115141_0s.png)
三个520专属Python表白代码分享
2023-09-19 21:20:06
![](https://img.aspxhome.com/file/2023/9/62889_0s.png)