一、下載python3.7.3版本的壓縮包
wget http://www.python.org/ftp/python/3.7.3/Python-3.7.3.tgz
二、下載完成后解壓,進入Python-3.7.3文件夾
挨個執行以下三個操作
./configure
make
make install
在執行make過程中會出現很多問題,這些問題一定要一一排查解決,例如:
仔細看警告或者錯誤的提示,安裝缺少的工具(本人展示的是在centos系統上安裝,若在ubuntu上使用apt-get命令,包名稱自行百度)
yum install ncurses-devel
yum install libuuid-devel
yum install -y zlib zlib-devel
yum install sqlite-devel
yum install readline-devel
yum install tkinter
yum -y install tcl-devel tk-devel
yum install lzma
yum install libgdbm-dev
yum install xz-devel
參考鏈接:https://www.cnblogs.com/bigriverx/p/8743008.html
此文意在解決下面這個問題:
Could not build the ssl module!
Python requires an OpenSSL 1.0.2 or 1.1 compatible libssl with X509_VERIFY_PARAM_set1_host().
LibreSSL 2.6.4 and earlier do not provide the necessary APIs, https://github.com/libressl-portable/portable/issues/381
意思是:python與目前系統上的openssl不兼容,只兼容OpenSSL 1.0.2版本或1.1以上版本的 libssl
具體為什么高版本要用到libssl 是因為openssl的漏洞問題,感興趣的朋友可以百度一下。
安裝libressl-2.6.4以上版本的依賴模塊
安裝教程:https://blog.csdn.net/scorpio921/article/details/82682757
下載地址:https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.7.4.tar.gz