CentOS6.5安裝python3.7

CentOS6.5安裝python3.7

一、下載python3

wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz

2.解壓

[root@mycentos ~]# tar -xzvf Python-3.7.0.tgz

先創建一個編譯目錄python

[root@mycentos ~]# mkdir /usr/local/python3

Python3.7版本須要一個新的包libffi-devel,安裝此包以後再次進行編譯安裝便可。centos

[root@mycentos ~]# yum install -y libffi-devel

而後編譯、安裝:code

[root@mycentos ~]# cd Python-3.7.0
[root@mycentos ~]# ./configure --prefix=/usr/local/python3
[root@mycentos ~]# make
[root@mycentos ~]# make install

創建軟鏈接get

[root@mycentos ~]# ln -s /usr/local/python3/bin/python3 /usr/bin/python3

查看版本編譯

[root@mycentos ~]# python3 -V

Python 3.7.0
相關文章
相關標籤/搜索