Commit 412d9cfb by larosa

py3.8 install script

parent 4bf72ed0
Showing with 38 additions and 0 deletions
#!/bin/bash
# python3.8 安装脚本 仅作参考
# 如果 yum源有问题 ,可以使用华为yum源 下面不是必做的 wget 可以换为 curl
#cp -a /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
#wget -O /etc/yum.repos.d/CentOS-Base.repo https://repo.huaweicloud.com/repository/conf/CentOS-7-anon.repo
#yum clean all
#yum makecache
# 注意切换到正确的文件路径下
yum install -y gcc openssl-devel bzip2-devel libffi-devel wget
wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz
tar -zxvf Python-3.8.0.tgz
cd Python-3.8.0
mkdir -p /usr/local/python3.8
./configure --enable-optimizations --prefix=/usr/local/python3.8
make
#注意 不要使用 make install 否则会覆盖已存在的python 版本,导致错误
make altinstall
ln -s /usr/local/python3.8/bin/python3.8 /usr/bin/python3.8
ln -s /usr/local/python3.8/bin/pip3.8 /usr/bin/pip3.8
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment