安装依赖
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc libffi-devel
cd /usr/local/
mkdir python3
cd Python3/
wget https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tgz
tar -zxf Python-3.8.2.tgz
cd Python-3.8.2
编译
./configure
make
make install
创建新的软连接
ln -s /usr/local/bin/python3.8 /usr/bin/python -f
ln -s /usr/local/bin/Pip3 /usr/bin/pip -f
调整yum配置和软件安装配置文件
修改yum文件,因为升级了版本以后,yum就会报错
vi /usr/bin/yum
#!/usr/bin/python 修改为 #!/usr/bin/python2.7
在安装软件的时候又会报错误
vi /usr/libexec/urlgrabber-ext-down
#!/usr/bin/python 修改为#!/usr/bin/python2.7
pip升级
pip install --upgrade pip
添加新评论