【问题标题】:unable to comile PostgreSQL with error message "could not find shared library for Python"无法编译 PostgreSQL 并显示错误消息“找不到 Python 的共享库”
【发布时间】:2020-04-15 19:46:37
【问题描述】:

我一直在尝试在 Windows 10 环境中使用 MSYS2 构建 REL_10_STABLE 版本的PostgreSQL
这是我为配置构建而执行的命令:

./configure --enable-thread-safety --enable-nls --with-ldap --with-openssl --with-ossp-uuid --with-libxml --with-libxslt --with-icu --with-tcl --with-perl --with-python

但我收到此错误消息:

正在检查 python...否
检查 python3... 否
正在检查 python2.../mingw64/bin/python2
检查 Python distutils 模块...是
检查 Python 配置目录... C:/msys64/mingw64/lib/python2.7/config
检查 Python 包含目录... -IC:/msys64/mingw64/include/python2.7
检查如何链接嵌入式 Python 应用程序...配置:错误:找不到 Python 的共享库
您可能必须重新构建 Python 安装。参考
有关详细信息的文档。使用 --without-python 禁用构建
PL/Python。

如您所见,安装了 python 2.7,这是我需要使用的版本,我需要使用 python 构建 python,但我不断收到错误消息 "could not find shared library for Python"
非常感谢任何帮助.

谢谢
山姆

【问题讨论】:

    标签: python postgresql python-2.7 msys2 postgresql-10


    【解决方案1】:

    您很可能已经构建了没有 --enable-shared 标志的 python 可执行文件。

    PostgreSQL 文档说明如下:

    由于 PL/Python 将是一个共享库,因此 libpython 库在大多数平台上也必须是一个共享库。在从源代码构建的默认 Python 安装中不是这种情况,但许多操作系统发行版中都有一个共享库。如果选择构建 PL/Python,配置将失败,但找不到共享的 libpython。这可能意味着您必须安装额外的包或重建(部分)您的 Python 安装以提供此共享库。从源代码构建时,使用 --enable-shared 标志运行 Python 的配置。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-12-12
      • 1970-01-01
      • 2017-06-07
      • 2015-03-05
      相关资源
      最近更新 更多