CentOS6.5下安裝Python3.6.2

1.安裝下列所需的依賴包: gcc zlib zlib-devel readline-devel

# yum install zlib-devel
# yum install readline-devel

注:readline-devel包用於解決退格鍵與方向鍵出現亂碼的問題python

2.下載Python3.6.2安裝包

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

3.解壓安裝包

# tar -xzvf Python-3.6.2.tgz

4.進入目錄

# cd Python-3.6.2

5.配置、檢查依賴

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

注:添加prefix前綴指定安裝的目標路徑測試

6.編譯&安裝

# make && make install

7.創建新的軟連接

# ln -s /usr/local/python3/bin/python3.6 /usr/bin/python3

8.測試運行

# python3 --version
# python3
相關文章
相關標籤/搜索