Centos7默認(rèn)安裝了python2 ,可以通過命令# pyhon -V查看python版本。
想要安裝python3的小伙伴看下面:
安裝參考文檔:How to Install Python 3.6.4 on CentOS 7?https://www.rosehosting.com/blog/how-to-install-python-3-6-4-on-centos-7/
安裝命令依次為:
#sudo yum install -y https://centos7.iuscommunity.org/ius-release.rpm
#sudo yum update
#sudo yum install -y python36u python36u-libs python36u-devel python36u-pip
中間需要兩次輸入用戶密碼,以及輸入y確認(rèn)。
安裝完成后,檢查是否安裝成功:
#python3.6 -V