linux安装python3

使用root账号

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

tar -zxf Python-3.4.4.tgz

cd Python-3.4.4

./configure

make

make install

输入python3即可

将python3切换到默认

sudo rm -rf /usr/bin/python

sudo ln -s /usr/local/bin/python3.4 /usr/bin/python

将python2切换到默认

sudo rm -rf /usr/bin/python

sudo ln -s /usr/bin/python2.7 /usr/bin/python

相关推荐