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 |
配置环境变量
$ echo -e "export PYTHON_HOME=/usr/local/python3.8\nexport PATH=\$PYTHON_HOME/bin:\$PATH" > /etc/profile.d/python3.8.sh |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 DevOps Technology Stack!
评论