用yum或者其它包管理器安装的py太旧了,大概是3.6版本,新版本官网上没有编译好的。现在把编译步骤记录下来方便以后使用。
1.下载
wget https://www.python.org/ftp/python/3.8.18/Python-3.8.18.tgz, tar -xvf Python-3.8.18.tgz
2.编译
cd Python-3.8.18
./configure –prefix=/usr/local/python3.8.18
make && make install
3.更新新的python链接
![在这里插入图片描述](https://img-blog.csdnimg.cn/3264ea193bb54278bac1e21941651805.png
ln -s /usr/local/python3.8.18/bin/python3.8 /usr/bin/python3
报错了,ls -ltr /usr/bin/python3
lrwxrwxrwx 1 root root 9 Oct 26 15:25 /usr/bin/python3 -> python3.6
所以先要sudo rm /usr/bin/python3,然后
ln -s /usr/local/python3.8.18/bin/python3.8 /usr/bin/python3
sudo rm /usr/bin/pip3
ln -s /usr/local/python3.8.18/bin/pip3.8 /usr/bin/pip3
4.升级
pip3 install –upgrade pip
版权声明:本文为博主作者:qq_25427995原创文章,版权归属原作者,如果侵权,请联系我们删除!
原文链接:https://blog.csdn.net/qq_25427995/article/details/134058840