How do I install plpython on MacOs X 10.5?

I have just installed PostgreSQL 8.3.4 on Mac OS X 10.5 (using ports), but I cannot figure out how to enable PL/Python. When I run the CREATE LANGUAGE plpythonu I get the following errors:

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

How can I fix it? Ideally I would prefer to avoid compiling Postgres without port or something like that.

Thia the output of running 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

(I've just switched from Linux to Mac a couple of days ago... In Ubuntu stuff like that used to just work, so I am pretty lost.)


Asked by: Dainton986 | Posted: 28-01-2022






Answer 1

Silly me:

[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

(I'd had universal.)

This means that you have to install the right variant of PostgreSQL to make your python functions fly.

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

Answered by: Steven280 | Posted: 01-03-2022



Similar questions

python - How to replace string values inside plpython?

Hi i need to replace value into null value in plpython, but how can i do that?Can somebody help? for example inside plpython sql i wrote. aa = 'World 123' bb = aa.replace('World ', '') rv = plpy.execute("SELECT id FROM ABC WHERE name ilike '" + bb + "';" ) But it doesnot work; if i use replace (aa,''), it shows error like, no global replace is defined..


python - plpython function to update a row is not working

I am using PostgreSQL 9.4.7 and Python 2.7.6. I am writing a plpython function to update a row in user table and my code is as below - CREATE FUNCTION update_user(myid int, mymail text, myname text) RETURNS text AS $$ from plpy import spiexceptions plan=plpy.prepare("UPDATE auth_user SET email=$2, username=$3 WHERE id = $1", ["int"] ["text"]["text"]) rv=plpy.execute(plan, [myid,myemail,myuse...


python - how to check if value return in plpython query?

I have this assignment in plpythonu in PostgreSQL function: result=plpy.execute("select value from table where doctitle like '%%%s%%'"%projectname) if result: final = result[0]["value"] The query can return 1 text result or nothing. The issue is that if the query returned nothing the if result: condition is still true (Cuz it contains th...






Still can't find your answer? Check out these communities...



PySlackers | Full Stack Python | NHS Python | Pythonist Cafe | Hacker Earth | Discord Python



top