我需要在Ubuntu 16.04中尝试使用预发布的Python 3.7和OpenSSL-1.1.1。按照如下链接中的指南,将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
我无法弄清楚问题在哪里以及需要做什么。
socketmodule.c
中的_socket
,但我认为这并不能解决你的问题。 - user3085931/usr/local/lib
(编译时如果没有传递其他参数,则为默认位置),请确保该位置已经在/etc/ld.so.conf
中,并且已经运行了ldconfig
来更新缓存以跟踪共享库的位置。 - Charles Duffyldd
的输出以确定可执行文件无法加载也是有帮助的。 - Charles Duffy