国产麒麟系统安装python3.10.0
进 root 用户 方便操作
1 | su root |
获取安装包 ( 可以根据需要下载其他版本,后面加的参数确保不因网络安全而报错)
1 | wget http://www.python.org/ftp/python/ 3.10 . 0 /Python -3.10 . 0 .tgz --no-check-certificate |
切进下载目录,解包刚下载的包
1 | tar xvf Python -3.10 . 0 .tgz |
切进解包后目录配置安装目录
1 2 | cd Python -3.10 . 0 ./configure --prefix=/usr/ local /python 310 |
创建安装目录
1 | mkdir /usr/ local /python 310 |
开始编译
1 2 | make<br> make install |
成功后有 Successfully installed pip-21.2.3 setuptools-57.4.0 类似语句
给新版本建立一个链接
1 | ln -s /usr/ local /python 310 /bin/python 3 /usr/bin/python 3 |
如果之前已存在 python3 的其他版本可以删除后在 建立链接
1 2 | rm /usr/bin/python 3 ln -s /usr/ local /python 310 /bin/python 3 /usr/bin/python 3 |