Re: libpython - cannot open shared object file

From: Tom Wilcox <hungrytom(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: libpython - cannot open shared object file
Date: 2010-06-16 14:02:43
Message-ID: AANLkTikv39hu9HVVHDlgjyFO7j0347Oncmwqu4DkETJH@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-novice

Interesting:

This works:

postgres(at)ubuntu64-bertha:~$ createlang -d cse plpythonu
Password:
postgres(at)ubuntu64-bertha:~$

But this doesn't:

postgres(at)ubuntu64-bertha:~$ psql -c "CREATE LANGUAGE plpythonu"
Password:
ERROR: could not load library
"/opt/PostgreSQL/8.4/lib/postgresql/plpython.so": libpython2.3.so.1.0:
cannot open shared object file: No such file or directory

Any suggestions? Feels like I'm not with the correct env vars in psql but
TBH Im getting somewhat dazed and confused from staring at this too long..

T

On 16 June 2010 14:58, Tom Wilcox <hungrytom(at)gmail(dot)com> wrote:

> Hi,
>
> I have got PostgreSQL 8.4 up and running on my Ubuntu Server 64-bit OS, but
> I am having difficulty with the PL/Python functions from my database. In
> particular, I am running this:
>
> -------------------------------------------------------
> drop language plpythonu cascade;
> create language plpythonu;
>
> -- Utility
> CREATE OR REPLACE FUNCTION min_float(a float, b float) RETURNS float AS $$
> return min(a,b);
> $$ LANGUAGE plpythonu;
>
> SELECT min_float(1,2);
>
> -------------------------------------------------------
>
> And receiving this error message:
>
> -------------------------------------------------------
> NOTICE: drop cascades to function min_float(double precision,double
> precision)
>
>
> ERROR: could not load library
> "/opt/PostgreSQL/8.4/lib/postgresql/plpython.so": libpython2.3.so.1.0:
> cannot open shared object file: No such file or directory
>
> ********** Error **********
>
> ERROR: could not load library
> "/opt/PostgreSQL/8.4/lib/postgresql/plpython.so": libpython2.3.so.1.0:
> cannot open shared object file: No such file or directory
> SQL state: 58P01
> -------------------------------------------------------
>
> The strange thing is that I have successfully created plpythonu language
> and the PLPythonu function(s). I was originally having difficulty getting
> PL/Python to install and it was throwing a similar error. However, this
> everntually went away once I added the PostgreSQL root install dir to the
> PATH variable (in my .bashrc and .bash_profile). I have both Python26 and
> Python31 installed (both came with ubuntu I believe).
>
> I am not sure that I have put my PATH and LD_LIBRARY_PATH settings into the
> correct .bash_profile and .bashrc files so that PgAdmin3 and psql (being
> opened by other users) will have the correct settings.
>
> Any ideas/help much appreciated?
>
> Thanks,
> Tom
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Filip Rembiałkowski 2010-06-16 14:14:01 Re: Monitoring activities of PostgreSQL
Previous Message Tom Wilcox 2010-06-16 13:58:08 libpython - cannot open shared object file

Browse pgsql-novice by date

  From Date Subject
Next Message Chris Campbell 2010-06-16 15:58:54 Re: Mixed case text searches
Previous Message Tom Wilcox 2010-06-16 13:58:08 libpython - cannot open shared object file