提前安装好系统依赖包:
centos:
yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel gcc gcc-c++ openssl-devel libffi-devel python-devel mariadb-devel
ubuntu:
sudo apt-get install zlib1g-dev libbz2-dev libssl-dev libncurses5-dev default-libmysqlclient-dev libsqlite3-dev libreadline-dev tk-dev libgdbm-dev libdb-dev libpcap-dev xz-utils libexpat1-dev liblzma-dev libffi-dev libc6-dev
1. 获取
wget https://www.python.org/ftp/python/3.8.6/Python-3.8.6.tgz
c
cd /tmp/Python-3.8.6/
2. 把Python3.8安装到 /usr/local 目录
./configure --prefix=/usr/local
make
make altinstall
3. 更改/usr/bin/python链接
ln -s /usr/local/bin/python3.8 /usr/bin/python3
ln -s /usr/local/bin/pip3.8 /usr/bin/pip3
Comments
Post a Comment