PostgreSQL 无法创建 plpythonu 扩展 [英] PostgreSQL unable to create plpythonu extension
问题描述
我正在尝试在 Windows 上的 PostgreSQL 中编写一个函数,主体中有一个 Python 脚本,但在尝试创建 plpythonu 扩展时遇到了错误消息.我正在运行的命令是:
I'm trying to write a function in PostgreSQL on Windows with a Python script in the body and i'm running into an error message when trying to create the plpythonu extension. The command I'm running is:
CREATE EXTENSION plpythonu;
产生以下错误信息:
ERROR: could not access file "$libdir/plpython2": No such file or directory
SQL state: 58P01
我也试过跑步:
CREATE EXTENSION plpython3u;
导致此错误:
ERROR: could not load library "C:/Program Files (x86)/PostgreSQL/9.2/lib/plpython3.dll": The specified module could not be found.
SQL state: 58P01
plpython3.dll 文件存在于该位置,但显然缺少一些关键依赖项.我到处搜索,发现没有任何帮助.我在机器上安装了 Python 2 和 3...
The plpython3.dll file exists at this location, but apparently is missing some critical dependency. I've searched everywhere and found nothing helpful on this. I have both Python 2 and 3 installed on the machine...
推荐答案
来自 EnterpriseDB 的最新(9.4 或更高版本)二进制安装仅包含 plpython3u.dll.在 9.4 到 9.6 版本中,我必须安装 python 3.3 才能运行 plpython3u.
The newest (9.4 or later) binary installations from EnterpriseDB contain only plpython3u.dll. In versions 9.4 to 9.6 I had to install python 3.3 to get plpython3u run.
您可以使用 Dependency Walker 检查 plpython3u.dll 需要哪个版本的 Python.
这篇关于PostgreSQL 无法创建 plpythonu 扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!