Linux之python版本升级
四、python3升级步骤
1、下载安装包
wget https://www.python.org/ftp/python/3.8.8/Python-3.8.8.tgz
2、解压软件包
tar -zxvf Python-3.8.8.tgz
3、预编译
注意在编译结束后会有提示"If you want a release build with all stable optimizations active (PGO, etc),please run ./configure --enable-optimizations",加上–enable-optimizations预编译的话后续编译会报错“Could not import runpy module ”,原因是gcc版本太低,enable-optimizations参数要求gcc版本8.1.0以上。
cd Python-3.8.8
./configure
4、编译
make
if test `uname -s` = Darwin; then
cp python-config.py python-config;
fi
5、编译安装
make install
Collecting setuptools
Collecting pip
Installing collected packages: setuptools, pip
Successfully installed pip-18.1 setuptools-40.6.2
6、升级后版本检查
python3 -V
Python 3.8.8