【问题标题】:Installing Python 3.7 on Freebsd 11 with ssl使用 ssl 在 Freebsd 11 上安装 Python 3.7
【发布时间】:2018-10-10 13:39:28
【问题描述】:

我正在尝试在支持 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:

似乎安装支持 ssl 的 Python(我认为使用 tarball 中的 openssl)应该很简单。这样做的正确方法是什么?

【问题讨论】:

  • @MateuszPiotrowski 许多端口都没有损坏,如果是,端口中不应该存在端口!即使那样,新版本的 openssl 也不会被任何不需要它的端口使用。

标签: python openssl freebsd


【解决方案1】:

我已经搞定了。

我需要跑步

pkg install openssl

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

【讨论】:

    【解决方案2】:

    我有同样的问题,但我选择升级 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。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-01-09
      • 2022-11-15
      • 2021-05-21
      • 2019-06-14
      • 2020-07-02
      • 2019-07-26
      • 1970-01-01
      相关资源
      最近更新 更多