Centos7 安装python3.7.2
下载python3.7.2源码
wget https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tgz
下载完后对压缩包解压缩
tar -xf Python-3.6.3.tgz
进入解压缩完后的文件夹:
cd Python-3.7.2
配置(需要加上--with-ssl,不然pip不能安装相关函数库,python3.7.2 pip 出现locations that require TLS/SSL异常处理方法)
./configure --with-ssl
编译
sudo make
安装
sudo make install
遇到以下报错:
zipimport.ZipImportError: can't decompress data
解决:Python安装常见问题:zipimport.ZipImportError: can't decompress data; zlib not available 解决办法
ModuleNotFoundError: No module named '_ctypes'
解决:Python安装常见问题:ModuleNotFoundError: No module named '_ctypes' 解决办法
安装完成!
参考:
https://www.cnblogs.com/kaid/p/7639107.html
https://blog.csdn.net/metoo9527/article/details/80330877