1. 程式人生 > >CentOS 7下安裝Python3.5

CentOS 7下安裝Python3.5

CentOS 7下安裝Python3.5

•安裝python3.5可能使用的依賴

yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel

CentOS 7安裝Python3.5

•到python官網找到下載路徑, 用wget下載

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

CentOS 7安裝Python3.5

•解壓tgz包

tar -zxvf Python-3.5.1.tgz

CentOS 7安裝Python3.5

•把python移到/usr/local下面

mv Python-3.5.1 /usr/local

•刪除舊版本的python依賴

ll /usr/bin | grep python

rm -rf /usr/bin/python

CentOS 7安裝Python3.5

•進入python目錄

cd /usr/local/Python-3.5.1/

•配置

./configure

CentOS 7安裝Python3.5

•編譯 make

make

CentOS 7安裝Python3.5

•編譯,安裝

make install

CentOS 7安裝Python3.5

•刪除舊的軟連結,建立新的軟連結到最新的python

rm -rf /usr/bin/python

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

python -V

CentOS 7安裝Python3.5

Enjoy your Python!

下面關於Python的文章您也可能喜歡,不妨看看: