1. Überprüfen Sie die Python-Version
[root@bogon ~]
Python 2.7 .5
[root@bogon ~]
2. Installieren Sie die erforderlichen Bibliotheksdateien
yum -y install zlib zlib-devel gcc
很重要,要不装不了包
yum install openssl-devel -y
3. Laden Sie python3.6.1 in das Verzeichnis /usr/local herunter
wget https://www.python .org /ftp/python/3.6 .1 /Python-3.6 .1 .tar .xz
4. Entpacken und installieren
5. Fügen Sie Umgebungsvariablen dauerhaft hinzu
添加export PATH="\$PATH:/usr/local/python3/bin"
添加完成后 source /etc/profile
**临时添加环境变量为
6. Öffnen Sie Python3.6
[root@bogon ~]
Python 3.6 .1 (default , May 19 2017 , 04 :11 :00 )
[GCC 4.8 .5 20150623 (Red Hat 4.8 .5 -11 )] on linux
Type "help" , "copyright" , "credits" or "license" for more information.
7. Ändern Sie den Link /usr/bin/python
修改后可直接用