在linux中安装Python
基本环境:
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make
常用解压包解压命令:
tar -xvJf .tar.xz //解压.tar.xz
tar -xvf .tar //解压.tar
tar -zxvf .tar.gz //解压.tar.gz
1、选安装包
2、上传到机器进行解压
wget https://www.python.org/ftp/python/3.7.12/Python-3.7.12.tgz //下载到机器
tar -zxvf Python-3.7.12.tgz //解压
cd Python-3.7.12 //进入根目录
3、编译安装
./configure --prefix=/usr/local/python3
make && make install
//添加软件链接
ln -s /usr/local/python3/bin/python3 /usr/bin/python
//查看安装是否成功
python3 --version