在centos6.4下安装python3.5

1、安装依赖包./configure --prefix=/usr/local/python3.5 --enable-shared make make installyum groupinstall Development Toolsyum install zlib-devel bzip2-devel openssl-devel ncurses-devel -y2、下...

1、安装依赖包

./configure --prefix=/usr/local/python3.5 --enable-shared make && make install

yum groupinstall 'Development Tools'

yum install zlib-devel bzip2-devel  openssl-devel ncurses-devel -y

2、下载python3.5安装包

wget --no-check-certificate https://www.python.org/ftp/python/3.5.0/Python-3.5.0.tgz

3、解压安装包

tar -zxvf Python-3.5.0.tgz
4、安装python3.5

cd Python-3.5.0

./configure --prefix=/usr/local/python3

make && make install

echo 'export PATH=$PATH:/usr/local/python3/bin' >> ~/.bashrc

5、创建链接

ln -s /usr/local/python3.5/bin/python3 /usr/bin/python3

cp -R /usr/local/python3.5/lib/* /usr/lib64/

6、测试安装是否成功

[root@h3 ~]# python3
Python 3.5.0 (default, Jan 25 2019, 11:18:20)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-23)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

本文标题为:在centos6.4下安装python3.5