- 下载源码包
https://www.python.org/downloads/
- 解压(以3.64版本为例)
wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz
tar -zxvf Python-3.6.4.tgz
cd Python-3.6.4
- 安装
./configure --prefix=/usr/local/python3
make && make install
- 添加软链接
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
- 安装第三方库
yum install python-pip
pip install --upgrade pip
python3 -m pip freeze
python3 -m pip install redis
python3 -m pip install pymongo
python3 -m pip install pymysql
python3 -m pip install configparser
豆瓣源:
pip Install:pip install -i https://pypi.douban.com/simple/