环境:华为云耀服务器 CentOS7
- 升级python3.7
CentOS7默认的python版本是2.7的,too old,所以个人决定升级到3.7,毕竟代码是在Python3环境下coding的。
1)首先需要安装一些依赖包:
yum install zlib-devel libffi-devel openssl-devel -y
前面两个是Python3.7编译的时候需要,否则会编译出错。openssl是pip需要的,如果不安装,pip安装第三方库的时候就会出现如下错误:
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
2)然后就是下载解压已经安装
#下载
wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz
#解压
tar Jxvf Python-3.7.3.tar.xz
#进入python3.7.3目录
cd Pyt