【发布时间】:2019-05-01 18:42:21
【问题描述】:
从源代码构建 Python 3.7 遇到以下错误:
Failed to build these modules:
_hashlib _ssl
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
我从其他 stackoverflow-questions 尝试了很多解决方法,但它不起作用。我从源代码构建最新的 OpenSSL 和 LibreSSL。 OpenSSL 路径为:“/usr/local/ssl”,版本为 OpenSSL 1.0.2p。
./configure --with-openssl=/usr/local/ssl/
(./configure CPPFLAGS="-I/usr/local/ssl/include" LDFLAGS="-L/usr/local/ssl/lib")
make
make altinstall
我的系统: Ubuntu 12.04.5 LTS
有什么想法吗?
【问题讨论】:
-
您的 Ubuntu 版本看起来非常旧。考虑升级到 18.04 LTS,它会让很多这样的问题简单地消失。
标签: python python-3.x ssl openssl