linux源码编译安装python并配置环境变量
发表于:2021-10-09 15:24:20浏览:349次
linux源码编译安装python并配置环境变量
① python源码编译安装
# yum install 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 -y # wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz # xz -d Python-3.7.3.tar.xz # tar -xf Python-3.7.3.tar # ./configure --prefix=/usr/local/software/python # make && make install
② 配置python环境变量
# vim /etc/profile export PATH=$PATH:/usr/local/software/python/bin
③ 刷新环境变量并验证python版本