python离线安装

tlylucky / 2023-07-31 / 原文

    1.安装yum

https://www.python100.com/html/63851.html

2.卸载原本系统中的python
参考:https://www.python100.com/html/W9610GF0KY1P.html

3.官网下载python对应安装版本的包
https://www.python.org/downloads/

4.解压python包
tar -zxvf Python-3.6.9.tgz
5.进入到python-3.6.9目录
cd Python-3.6.9

配置命令:./configure --prefix=/usr/local/python3
6.编译、命令: make && make install

7.配置环境变量:vim /etc/profile 在最下面加上路径然后Esc退出,:wq!保存文件

8.手动读取 source /etc/profile,加载文件中的所有变量

 9.查看python -V版本是否已经有了

10.安装想要的新版的pip,先到官网下载

https://pypi.org/project/pip/#files

11.上传文件然后解压安装

上传:可以用xshell(百度一下挺简单的)或者安装rz

解压:tar vxf  'pip-21.3.1 (1).tar.gz'

安装:python setup.py install

12.然后配置软连接

ln -s /usr/local/python3/bin/pip3.6 /usr/bin/pip

13.查看pip -V版本

14.安装第三方需要的依赖包

参考:https://blog.csdn.net/besmarterbestronger/article/details/86541109

其中下载地址可以变命令修改为:其中 -d /package是要下载到对应的文件夹,我没有用我是直接进入到package 然后下载的

pip download -r test.txt -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com -d /package

 

其他下载文件地址有以下几种:

1)http://mirrors.aliyun.com/pypi/simple/ 阿里云
2)https://pypi.mirrors.ustc.edu.cn/simple/ 中国科技大学
3)http://pypi.douban.com/simple/ 豆瓣
4)https://pypi.tuna.tsinghua.edu.cn/simple/ 清华大学
5)http://pypi.mirrors.ustc.edu.cn/simple/ 中国科学技术大学

 

allure官网下载路径:https://repo.maven.apache.org/maven2/io/qameta/allure/

wget https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/2.12.0/allure-commandline-2.12.0.tgz -d /packages/