依赖安装:
yum -y groupinstall "Development tools"
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
yum install libffi-devel -y
下载链接:https://www.python.org/downloads/source/
目前最新版本:wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tar.xz
编译安装:
./configure --prefix=/usr/local/python3
#./configure --prefix=/usr/local/python3 --enable-optimizations
make && make install
安装Python3时,会自动安装pip。假如没有,需要自己手动安装。
yum -y install python-pip
创建软链接:
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
更新pip:
pip3 install --upgrade pip
安装扩展包:
解压后,
python setup.py install
网友评论