首页 文章

使用ssl在Freebsd 11上安装Python 3.7

提问于
浏览
2

我正在尝试使用ssl支持在Freebsd 11.1上安装Python 3.7 .

尝试#1:由于未找到libdl.so.1,预先构建的二进制文件将无法运行

pkg install python37
...
root@s0001:~ # python3.7
Shared object "libdl.so.1" not found, required by "python3.7"

尝试#2:我下载了python 3.7源代码并尝试使用默认值进行构建,但未找到ssl模块

./configure
make
...
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_gdbm                 _sqlite3              _ssl
_tkinter              spwd
To find the necessary bits, look in setup.py in detect_modules() for the module's name.

尝试#3:我注意到python tarball里面有openssl 1.1.1的源代码所以我尝试了--with-openssl,但是遇到了编译错误:

./configure --with-openssl=openssl-1.1.1
make

openssl-1.1.1/include/openssl/bn.h:332:1: error: expected function body after function declarator

DEPRECATEDIN_0_9_8(int
^
openssl-1.1.1/include/openssl/bn.h:403:1: error: expected function body after function declarator
DEPRECATEDIN_0_9_8(int BN_get_params(int which)) /* 0, mul, 1 high, 2 low, 3
^
In file included from /root/Python-3.7.0/Modules/_hashopenssl.c:23:
In file included from openssl-1.1.1/include/openssl/evp.h:28:
In file included from openssl-1.1.1/include/openssl/objects.h:15:

似乎安装Python支持ssl(我认为使用tarball中的openssl)应该是直截了当的 . 这样做的正确方法是什么?

2 回答

  • 0

    我有同样的问题,但我选择升级FreeBSD而不是重建python .

    FreeBSD 11.2在this commit中添加了libdl,我们在the 11.2 source中看到但不是the 11.1 source (404) . 自2018-09-30以来,11.1已经unsupported .

    因此,此包和可能的其他包可能在11.1上具有相同的症状(libdl缺失),因为正在进行的包构建不再需要支持11.1 .

  • 1

    我有它的工作 .

    我需要跑

    pkg install openssl
    

    然后我能够使用默认值构建和安装(即在尝试#2之后)

相关问题