【问题标题】:How do I install plpython on MacOs X 10.5?如何在 MacOs X 10.5 上安装 plpython?
【发布时间】:2010-09-19 07:51:46
【问题描述】:

我刚刚在 Mac OS X 10.5(使用端口)上安装了 PostgreSQL 8.3.4,但我不知道如何启用 PL/Python。当我运行CREATE LANGUAGE plpythonu 时出现以下错误:

ERROR:  could not access file "$libdir/plpython": No such file or directory
STATEMENT:  CREATE LANGUAGE plpythonu;
psql:<stdin>:18: ERROR:  could not access file "$libdir/plpython": No such file or directory

我该如何解决?理想情况下,我宁愿避免在没有 port 或类似的情况下编译 Postgres。

Thia 运行 pg_config 的输出:

BINDIR = /opt/local/lib/postgresql83/bin
DOCDIR = 
INCLUDEDIR = /opt/local/include/postgresql83
PKGINCLUDEDIR = /opt/local/include/postgresql83
INCLUDEDIR-SERVER = /opt/local/include/postgresql83/server
LIBDIR = /opt/local/lib/postgresql83
PKGLIBDIR = /opt/local/lib/postgresql83
LOCALEDIR = 
MANDIR = /opt/local/share/man
SHAREDIR = /opt/local/share/postgresql83
SYSCONFDIR = /opt/local/etc/postgresql83
PGXS = /opt/local/lib/postgresql83/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--prefix=/opt/local' '--sysconfdir=/opt/local/etc/postgresql83' '--bindir=/opt/local/lib/postgresql83/bin' '--libdir=/opt/local/lib/postgresql83' '--includedir=/opt/local/include/postgresql83' '--datadir=/opt/local/share/postgresql83' '--mandir=/opt/local/share/man' '--without-docdir' '--with-includes=/opt/local/include' '--with-libraries=/opt/local/lib' '--with-openssl' '--with-bonjour' '--with-readline' '--with-zlib' '--with-libxml' '--with-libxslt' '--enable-thread-safety' '--enable-integer-datetimes' '--with-ossp-uuid' 'CC=/usr/bin/gcc-4.0' 'CFLAGS=-O2' 'CPPFLAGS=-I/opt/local/include -I/opt/local/include/ossp' 'CPP=/usr/bin/cpp-4.0' 'LDFLAGS=-L/opt/local/lib'
CC = /usr/bin/gcc-4.0 -no-cpp-precomp
CPPFLAGS = -I/opt/local/include -I/opt/local/include/ossp -I/opt/local/include/libxml2 -I/opt/local/include
CFLAGS = -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline -Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -fwrapv
CFLAGS_SL = 
LDFLAGS = -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib
LDFLAGS_SL = 
LIBS = -lpgport -lxslt -lxml2 -lssl -lcrypto -lz -lreadline -lm 
VERSION = PostgreSQL 8.3.4

(几天前我刚从 Linux 切换到 Mac……在 Ubuntu 中,像以前那样正常工作,所以我很迷茫。)

【问题讨论】:

  • 请接受您自己的答案,以便 (1) 很明显有用的答案是什么,并且 (2) 没有其他人会花很多时间来回答这个问题。

标签: python macos postgresql


【解决方案1】:

愚蠢的我:

[lib/postgresql83] > variants postgresql83
 postgresql83 has the variants:
    universal
    python: add support for python
    krb5: add support for Kerberos 5 authentication
    perl: add Perl support

(我有universal。)

这意味着您必须安装正确的 PostgreSQL 变体才能使您的 python 函数运行。

$ sudo port install postgresql83 +python postgresql-server +python

【讨论】:

    猜你喜欢
    • 2010-10-15
    • 2013-02-03
    • 2011-01-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-20
    • 2011-02-04
    • 2010-10-12
    相关资源
    最近更新 更多