Linux 编译安装 Python3.8
下载源码包进入Python官网,下载指定版本的源码包。
这里以python3.8.13为例:
$ wget https://www.python.org/ftp/python/3.8.13/Python-3.8.13.tgz
编译源码安装编译所需的依赖:
$ yum install -y gcc patch libffi-devel python-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
进行编译安装:
$ tar xf Python-3.8.13.tgz$ cd Python-3.8.13$ ./configure --prefix=/usr/local/python3.8/ # /usr/local/python3.8/ 是安装的目录$ make && make install
配置环境变量$ echo -e " ...