安裝依賴
- yum -y groupinstall "Development tools"
- yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel libpcap-devel xz-devel libffi-devel
下載源碼包透典, 編譯安裝
- wget https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tar.xz
- tar -xvJf Python-3.8.5.tar.xz
- cd Python-3.8.5
- ./configure -prefix=/usr/local/python3
- make && make install
設(shè)置軟連接
- ln -s /usr/local/python3/bin/python3 /usr/bin/python3
- ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
[root@console Python-3.8.5]# python3
Python 3.8.5 (default, Sep 21 2020, 11:16:18)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>