下载包:https://www.python.org/downloads/release/python-353/
安装python3.5
安装依赖:
yum install readline-devel -y #不安装会导致python解释器里面没法用删除键等
解压安装:
tar -zxvf Python-3.5.1.tgz cd Python-3.5.1 ./configure --prefix=/usr/local/python3 --enable-shared make && make install
#做命令软连接
echo "export PATH=$PATH:/usr/python3/bin" >> /etc/profile source /etc/profile echo /usr/python3/lib >> /etc/ld.so.conf ldconfig
#安装完成,执行下
[root@localhost ~]# python3 Python 3.5.1 (default, Jun 29 2016, 15:56:00) [GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux Type “help”, “copyright”, “credits” or “license” for more information. >>>