sudo yum install yum-utils
若是報錯提示相似is not in the sudoers file. This incident will be reported.則證實當前用戶沒有執行sudo的權限,解決方法是以root用戶身份修改
/etc/sudoers文件,記住該文件默認只讀使用chmod命令賦予寫入權限,再編輯該文件,在root ALL=(ALL) ALL下面添加: 你的用戶名 ALL=(ALL)ALL
而後保存退出python
sudo yum-bulddep python
curl -O https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz
tar xf Python-3.7.0.tgz cd Python-3.7.0 ./configure make sudo make install
python3 -V 檢查是否安裝成功
5 - 修改python3.7 做爲默認python
bootstrap
vim /etc/profile.d/python.sh ## 在該文件裏增長如下一行 ## alias python=' /usr/local/bin/python3.7' #重啓會話使之生效 source /etc/profile.d/python.sh
sudo yum install epel-release
sudo yum install python37
curl -O https://bootstrap.pypa.io/get-pip.py sudo /usr/bin/python3.7 get-pip.py