我的用的系統是CentOS7 裏面默認安裝了比較老的python2.7python
下載最新版pythoncentos
wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz
若是沒有wget,請先安裝wgetpython2.7
yum install wget
解壓ui
tar -xvf Python-3.6.2.tar.xz
[root@VM_58_11_centos ~]# cd Python-3.6.2 定位到文件夾 #查看安裝包文件 [root@VM_58_11_centos Python-3.6.2]# ls aclocal.m4 config.sub configure.ac Grammar install-sh LICENSE Makefile.pre.in Modules Parser PCbuild Python setup.py config.guess configure Doc Include Lib Mac Misc Objects PC pyconfig.h.in README Tools [root@localhost Python-3.6.2]# ./configure 添加配置 [root@localhost Python-3.6.2]# make 編譯源碼 [root@localhost Python-3.6.2]# make install 執行安裝