sudo yum install yum-utils
curl -O https://www.python.org/ftp/python/3.5.0/Python-3.5.0.tgz
tar xf Python-3.5.0.tgz
cd Python-3.5.0
./configure
make
sudo make install
python3 –version
1 |
Python 3.5.0 |
If you want to use python3 as your default Python interpreter, you can define the following alias in your .bashrc.
1 |
alias python='/usr/local/bin/python3.5' |
1 |
1 |
如果还有2.7的或者其他的修改这个路径的export |
1 |
vi ~/.bash_profile |
软连接,使得调用Python相当于调用Python3
1 |
ln -s /usr/local/bin/python3.5 /usr/bin/python |