【发布时间】:2018-10-19 04:16:13
【问题描述】:
我需要在 Ubuntu 16.04 中尝试使用带有 openssl-1.1.1 的 python 3.7。 python 和 openssl 版本都是预发布的。按照a previous post 中有关如何将openssl 统计链接到python 的说明,我下载了opnssl-1.1.1 的源代码。 然后导航到 openssl 的源代码并执行:
./config
sudo make
sudo make install
然后,编辑 Modules/Setup.dist 以取消注释以下行:
SSL=/usr/local/ssl
_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto
然后下载python 3.7源代码。然后,在源代码中导航并执行:
./configure
make
make install
在我执行make install之后,在终端输出的末尾出现了这个错误:
./python: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
generate-posix-vars failed
Makefile:596: recipe for target 'pybuilddir.txt' failed
make: *** [pybuilddir.txt] Error 1
我无法弄清楚问题出在哪里以及我需要做什么。
【问题讨论】:
-
您也忘记取消注释
_socket socketmodule.c但这不能解决您的问题 AFAIK -
你的 SSL 库——如果它们在
/usr/local/lib中(默认位置,如果你在编译时没有将任何其他参数传递给./config),请确保该位置在你的@987654333 中@,并且您已经运行ldconfig来更新缓存跟踪共享库位置。 -
除此之外,检查
ldd的输出以找出无法加载可执行文件的原因也很有帮助。
标签: python ssl openssl pyopenssl