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