# 在安装python3前,我们需要安装一些必要的依赖包,直接通过 yum 命令安装即可。命令如下:
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
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz
tar xf Python-3.7.0.tgz
cd Python-3.7.0
./configure --help
./configure --with-ssl
make && make install
python3 -V
'''
更换pip为豆瓣源并升级pip (pypi.douban.com的存储库不是受信任的或安全的主机,正在被忽略。
要求使用“–trusted host pypi.douban.com”允许此警告。)
'''
pip3 install --upgrade pip -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
# 安装psutil模块
pip3 install psutil -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
# 升级pip后
pip3 install psutil