Centos7.4 yum安裝python3.6

安裝python3.6python

yum install epel-release -y
yum install https://centos7.iuscommunity.org/ius-release.rpm -y
yum install python36u-devel python36u -y
yum install python36u-pip -y

取消centos7.4自帶的python2.7的軟連接,改成python3.6的vim

cd /usr/bin/
mv python python.bak
ln -s python3.6 python
ln -s pip3.6 pip

而後就能夠用鍵入python查看版本centos

由於yum依賴python環境,這裏 更改了會有問題出現,因此咱們還得更改yum配置bash

vim /usr/bin/yum
將第一行的 #!/usr/bin/python
修改成 #!/usr/bin/python2.7
vim /usr/libexec/urlgrabber-ext-down
將第一行的 #!/usr/bin/python
修改成 #!/usr/bin/python2.7

至此,centos7.4安裝python3.6就徹底ok了python2.7

~url

相關文章
相關標籤/搜索