-
安装依赖包
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc* make -y
-
下载python安装包
wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tar.xz
-
解压python安装包
tar -Jxvf Python-3.5.2.tar.xz
-
配置安装路径
切入到解压目录下
./configure prefix=/usr/local/python3
-
编译安装
切入到解压目录下
make && make install
-
配置软连接
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
-
导出之前python安装的包的清单
pip freeze > requirements.txt
-
安装清单
Pip install -r requirements.txt