Centos 6.5安装python3.5.1

时间:2020-12-20 23:03:52

查看python的版本

 

[plain]  view plain  copy
 
 print?
  1. #python  -V    
  2. Python 2.6.6  


1.下载Python-3.5.1

[plain]  view plain  copy
 
 print?
  1. #wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tgz


2.解压 

[plain]  view plain  copy
 
 print?
  1. #tar -zxf Python-3.5.1.tgz 


3.更改工作目录

[plain]  view plain  copy
 
 print?
  1. #cd Python-3.5.1  


4.安装

[plain]  view plain  copy
 
 print?
  1. #./configure  (这一句如果报错,需要运行yum install gcc)
  2. #make        
  3. #make install  

 

  • 测试
[root@localhost Python-3.5.1]# python3 Python 3.5.1 (default, Jun 27 2016, 07:47:54) [GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linux Type "help", "copyright", "credits" or "license" for more information. >>>