Centos7下安裝Python3.7(轉載)
Centos7下安裝Python3.7
首先安裝依賴包,centos裡面是-devel,如果在ubuntu下安裝則要改成-dev,依賴包缺一不可,筆者曾安裝python3未成功就是因為沒有安裝libffi-devel
sudo yum -y groupinstall "Development tools"
sudo yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel
然後獲取python3.7的安裝包
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0a1.tar.xz
解壓
cd ~/Download
tar -xvJf Python-3.7.0a1.tar.xz
配置python3的安裝目錄並安裝
cd Python-3.7.0a1
./configure --preix=/usr/local/bin/python3
sudo make
sudo make install
建立軟連結
ln -s /usr/local/bin/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/bin/python3/bin/pip3 /usr/bin/pip3
最後在命令列中輸入python3,能夠進入python3終端即成功安裝
原文:https://blog.csdn.net/elija940818/article/details/79238813