首先把pip-18.0.tar.gz 、Python-3.6.5.tgz 安装包放在 /usr/local 下面,按照顺序先安装pip,再安装python。不要先安装或只安装python,否则很容易出错,#!/bin/bashfunc1(){while truedoecho 安装依赖包yum -y ...
首先把pip-18.0.tar.gz 、Python-3.6.5.tgz 安装包放在 /usr/local 下面,按照顺序先安装pip,再安装python。不要先安装或只安装python,否则很容易出错, #!/bin/bash func1(){ while true do echo "安装依赖包" yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel echo "安装pip" yum remove pip -y && cd /usr/local/ && tar -xf pip-18.0.tar.gz && cd pip-18.0/ && python setup.py install echo "安装python" cd /usr/local/ && tar -zxvf Python-3.6.5.tgz && mv Python-3.6.5 python3 && cd python3 && ./configure && make && make install mv /usr/bin/python /usr/bin/python.bak ln -s /usr/local/bin/python3 /usr/bin/python && ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3 whereis pip && /usr/local/bin/pip3.6 install --upgrade pip && /usr/local/bin/pip install paramiko sed -i "1c #!/usr/bin/python2.7" /usr/bin/yum sed -i "1c #!/usr/bin/python2.7" /usr/libexec/urlgrabber-ext-down sed -i "1c #!/usr/bin/python2.7" /usr/sbin/firewalld systemctl restart firewalld echo "全部安装完毕" exit done } func1
沃梦达教程
本文标题为:shell脚本安装python、pip--不需要选择安装项目
基础教程推荐
猜你喜欢
- Python爬取当网书籍数据并数据可视化展示 2023-08-11
- Python基础学习之函数和代码复用详解 2022-09-02
- Python 中 Elias Delta 编码详情 2023-08-08
- ubuntu 18 python3.6 的安装与 python2的版本切换 2023-09-03
- 四步教你学会打包一个新的Python模块 2022-10-20
- centos系统 anaconda3(python3)安装pygrib 2023-09-04
- CentOS 7.5 安装 Python3.7 2023-09-03
- python的环境conda简介 2022-10-20
- 基于Python实现股票数据分析的可视化 2023-08-04
- Centos7下安装python环境 2023-09-04