在python官网https://www.python.org/下载python3.10的tgz的源码包。
安装编译环境
apt-get update
apt install wget build-essential checkinstall
apt install libreadline-gplv2-dev libncursesw5-dev libssl-dev
apt install libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev
安装python
tar xzf Python-3.10.9.tgz
cd Python-3.10
编译
./configure --enable-optimizations
make install
pip相应的版本也会安装上了
按照这种方式安装后,执行下面命令进行软链接
ln -s /usr/local/bin/python3.10 /usr/local/bin/python
ln -s /usr/local/bin/pip3.10 /usr/local/bin/pip
https://cloud.tencent.com/developer/article/1846039
另外一种安装pip3.10的方法,用于参考
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
https://blog.csdn.net/nayanminxing/article/details/123760466