安装Python3.9,安装完后,使用Python3.9去执行。

安装命令如下:

wget https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tgz

sudo tar xzf Python-3.9.6.tgz

cd Python-3.9.6

./configure –enable-optimizations

make altinstall

python3.9 -V

如果系统有不同版本的Python3,可以使用这个方法更新:

重新映射Python3:
sudo rm /usr/bin/python3 #remove existing link

#create a new link to the version of your choice

sudo ln /usr/local/bin/python3.9 /usr/bin/python3

找不到安装目录到话,使用:which python3.9