Centos8 安装Python3.8.5

2020-08-1104:54:55
评论
4,676 612字
Centos8 安装Python3.8.5

# 安装依赖

dnf -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel libffi-devel gcc make wget tar

# 下载解压

wget https://oss.pealog.com/env/python/Python-3.8.5.tgz
tar -zxvf Python-3.8.5.tgz

# 配置编译

mkdir /etc/python
cd Python-3.8.5
./configure --prefix=/etc/python --enable-optimizations 
make && make install

# 建立软连接

ln -s /etc/python/bin/python3 /usr/bin/python3  
ln -s /etc/python/bin/pip3 /usr/bin/pip3

# 添加环境

echo "export PATH=$PATH:/etc/python/bin" >>/etc/profile
source /etc/profile

# 升级配置

python3 -m pip install --upgrade pip
#pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple/ 
pip3 install pipenv
python3 -V && pip3 -V 
豌豆日志
  • 本文由 发表于 2020-08-1104:54:55
  • 转载请务必保留本文链接:https://pealog.com/262.html
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: