Re: EnterpriseDB install of Postgres on Ubuntu 10.04 library path issues - no version information available (required by /lib/libblkid.so.1) - Mailing list pgsql-general

From Ashesh Vashi
Subject Re: EnterpriseDB install of Postgres on Ubuntu 10.04 library path issues - no version information available (required by /lib/libblkid.so.1)
Date
Msg-id CAG7mmozd7VAtdGLyE8pMaxu2KRmJxNTvLTyA0N92nEhXZ4k6hQ@mail.gmail.com
Whole thread Raw
In response to EnterpriseDB install of Postgres on Ubuntu 10.04 library path issues - no version information available (required by /lib/libblkid.so.1)  (Scott Chapman <scott@mischko.com>)
List pgsql-general
On Thu, Apr 5, 2012 at 4:11 AM, Scott Chapman <scott@mischko.com> wrote:
Downloaded http://get.enterprisedb.com/postgresql/postgresql-9.1.3-1-linux.run
Ran it.  Install went fine.
StackBuilder install of PostGIS 1.5 failed.  No error given.  I can't
find it in the logs. So I ran /tmp/edb_postgis_1_5_pg91.bin by hand.
Everything went fine there.

Then I wanted to install psycopg2 (2.4.5) so I can use PG with Python:

$ python setup.py build
running build
running build_py
running build_ext
Error: pg_config executable not found.

Please add the directory containing pg_config to the PATH
or specify the full executable path with the option:

   python setup.py build_ext --pg-config /path/to/pg_config build ...

or with the pg_config option in 'setup.cfg'.

$ export PATH=$PATH:/opt/PostgreSQL/9.1/bin/

Then the build worked fine.

# export PATH=$PATH:/opt/PostgreSQL/9.1/bin/
# python setup.py install

That worked.

Then try to import it in Python:

$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import psycopg2
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "/usr/local/lib/python2.6/dist-packages/psycopg2/__init__.py",
line 67, in <module>
   from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: libpq.so.5: cannot open shared object file: No such file
or directory
>>>

So I think I need to add the library path to ldconfig.

/etc/ld.so.conf.d# echo "/opt/PostgreSQL/9.1/lib/">postgresql.conf
root@schapman-desktop:/etc/ld.so.conf.d# ldconfig
/sbin/ldconfig.real: /opt/PostgreSQL/9.1/lib/libproj.so.0 is not a symbolic link

/sbin/ldconfig.real: /opt/PostgreSQL/9.1/lib/libpgtypes.so.3 is not a
symbolic link

/sbin/ldconfig.real: /opt/PostgreSQL/9.1/lib/libgeos-3.3.0.so is not a
symbolic link

/sbin/ldconfig.real: /opt/PostgreSQL/9.1/lib/libgeos_c.so.1 is not a
symbolic link

/sbin/ldconfig.real: /opt/PostgreSQL/9.1/lib/libpq.so.5 is not a symbolic link

/sbin/ldconfig.real: /opt/PostgreSQL/9.1/lib/libecpg.so.6 is not a symbolic link

/sbin/ldconfig.real: /opt/PostgreSQL/9.1/lib/libecpg_compat.so.3 is
not a symbolic link

Now I can import psycopg2 into Python and all seems well.

So I was working with stuff and went to unmount my usb stick:

$ umount /media/patriot

and I got this wierd error:
umount: /opt/PostgreSQL/9.1/lib/libuuid.so.1: no version information
available (required by /lib/libblkid.so.1)

And I'm stumped.  I think the EnterpriseDB build is using a different
version of some library than Ubuntu 10.04 has?
Yeah.
That's the case.
And, one of the reason, we (EnterpriseDB Installer team) do not include the PostgreSQL path in the ldconfig.

If I undo the ldconfig change, the error goes away, but psycopg2 won't load. 
Can reconfigure the psycopg2 with this rpath?
  python setup.py clean
  python setup.py build_ext --pg-config <PG_CONFIG_PATH> --rpath <PG_LIB_DIR> ..
  
i.e.
  python setup.py build_ext --pg-config /opt/PostgreSQL/9.0/bin/pg_config --rpath /opt/PostgreSQL/9.0/lib ...

Hope - this will help.

--

Thanks & Regards,

Ashesh Vashi
EnterpriseDB INDIA: 
Enterprise PostgreSQL Company

 

http://www.linkedin.com/in/asheshvashi


Clues appreciated!

Scott

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

pgsql-general by date:

Previous
From: Vincas Dargis
Date:
Subject: Re: PostgreSQL 8.4 crash on user defined C language function
Next
From: Martin Gregorie
Date:
Subject: Re: v8.3.4 metadata changes while users active