当前位置: 首页 > 后端技术 > Python

ubuntu16 安装 python3.10 遇到 openssl 版本过低问题以及解决方案

时间:2023-03-26 13:08:48 Python

在ubuntu16上安装python3.10遇到openssl版本过低的问题及解决方法有时,网络无法连接:WARNING:Retrying(Retry(total=4,connect=None,read=None,redirect=None,status=None))在连接被SSLError("Can'tconnecttoHTTPSURLbecausetheSSLmoduleisnotavailable.")中断后,我也未能导入ssl包。python3.10要求的openssl最低版本是1.1.1ubuntu16自带1.0.x。发现openssl的版本失效,最后自己下载编译了一个openssl来替换当前Python版本3.6到3.9,兼容OpenSSL1.0.2、1.1.0和1.1.1。在大多数情况下,Python也适用于LibreSSL>=2.7.1,但缺少一些功能和损坏的测试。具体参考:PEP644–需要OpenSSL1.1.1或更新版本