发布时间:2019-09-27 07:10:22编辑:auto阅读(2218)
Python3 与 Python2共存
查看当前python版本
python --version
备份python
which python
mv /usr/bin/python /usr/bin/python.bak
下载安装更新python3
wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz
tar -xvJf Python-3.6.2.tar.xz
安装关联程序,安装编译python3
yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make
cd Python-3.6.2
./configure prefix=/usr/local/python3
make && make install
ln -s /usr/local/python3/bin/python3 /usr/bin/python
查看python版本
python --version
修改相关执行程序python版本
vi /usr/bin/yum
把#! /usr/bin/python修改为#! /usr/bin/python2
vi /usr/libexec/urlgrabber-ext-down
文件里面的#! /usr/bin/python 也要修改为#! /usr/bin/python2
上一篇: python3批量为文件重命名
下一篇: python3 vs python2
48346
47164
38043
35317
29807
26491
25461
20430
20120
18571
172°
163°
171°
248°
210°
437°
288°
254°
276°
484°