Linux installation of Python 3.8.1

1, the installation required dependencies

[root@node02 ~]# yum -y install wget gcc zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel

2, download Python3.8.1

[root@node02 ~]# wget https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tgz

3, set the language

[root@node02 ~]# echo "LANG=zh_CN.UTF-8" >> /etc/profile
[root@node02 ~]# echo "LANGUAGE=zh_CN.UTF-8" >> /etc/profile
[root@node02 ~]# . /etc/profile

4, unpack and install compiled

[root@node02 ~]# tar zxf Python-3.8.1.tgz -C /usr/src
[root@node02 ~]# cd /usr/src/Python-3.8.1/
[root@node02 Python-3.8.1]# ./configure --prefix=/usr/local/python38 --enable-optimizations && make && make install

5, configure the environment variables

[root@node02 Python-3.8.1]# echo "PATH=$PATH:/usr/local/python38/bin" >> /etc/profile
[root@node02 Python-3.8.1]# . /etc/profile

6, see the python version

[root@node02 Python-3.8.1]# python3 --version
Python 3.8.1

-------- end of this article so far, thanks for reading --------

Guess you like

Origin blog.51cto.com/14154700/2462517