安装python3
- 官网下载tar.gz压缩包
- 解压压缩包
- 进入解压后的文件夹并打开终端
- 安装gcc编译环境
sudo zypper install -y gcc
- 执行下列命令
./configure
- 安装make包
sudo zypper install make
- 安装zlib相关依赖包
sudo zypper install zlib*
- 执行下列命令
make
sudo make install
修改系统默认版本为python3
执行下列命令
# sudo update-alternatives --list python
update-alternatives: error: no alternatives for python
# sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
update-alternatives: using /usr/bin/python2.7 to provide /usr/bin/python (python) in auto mode
# sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.4 2
update-alternatives: using /usr/bin/python3.4 to provide /usr/bin/python (python) in auto mode
网友评论