CentOS6.5安装Python3
从官网下载Python,官网下载地址:https://www.python.org/downloads/
这里以Python3.5.1为例:
wget https://www.python.org/ftp/python/3.5.0/Python-3.5.0.tgz
开始安装之前先装一个依赖包避免在交互模式下按方向键出现乱码的问题:
yum install readline-devel
开始安装:
tar -zxvf Python-3.5.1.tgz
cd Python-3.5.1
./configure
make && make install
安装成功后即可使用Python:
[root@iZ25emq8lq7Z ~]# python3 Python 3.5.1 (default, Feb 23 2017, 12:08:43) [GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> >>> print("Hello World!") Hello World! >>>
Kelvin
Hello World!