psycopg/psycopg2 - error at the loading

1,013 views
Skip to first unread message

uxmal

unread,
Jul 6, 2007, 9:43:48 AM7/6/07
to Django users
hello,
I know it isn't directly related to django, but well my django depends
on it...

yesterday I installed postgresql, mxBase, and psycopg 1.1 on openSUSE
10.2,
and it worked fine until today (Django is really cool!).

But after upgrading it mysteriously decided to stop working...


using psycopg :
Error loading psycopg module: libpq.so.5: cannot open shared object
file: No such file or directory

think it is related to a path configured somewhere, but even by re ./
configure-ing psycopg with the postgresql include&lib paths, psycopg
continues to show the error .. :(
or it can be changed somewhere in a psycopg conf ?


so I tried to use psycopg2, but now :
Error loading psycopg2 module: cannot import name tz
which is a bit enigmatic :)


thanks !

Thomas Guettler

unread,
Jul 6, 2007, 10:05:08 AM7/6/07
to django...@googlegroups.com
Am Freitag, 6. Juli 2007 15:43 schrieb uxmal:
> hello,
> I know it isn't directly related to django, but well my django depends
> on it...
>
> yesterday I installed postgresql, mxBase, and psycopg 1.1 on openSUSE
> 10.2,
> and it worked fine until today (Django is really cool!).
>
>
>
> using psycopg :
> Error loading psycopg module: libpq.so.5: cannot open shared object
> file: No such file or directory

This is the shared library provided by the postgres or postgres-devel
RPM.

It should be under /usr/lib or /usr/lib64.

Starting the sql shell (psql) should fail, too.

> But after upgrading it mysteriously decided to stop working...

What kind of upgrade? (SuSE, Django, Hardware, ...)

Thomas

uxmal

unread,
Jul 8, 2007, 2:54:46 PM7/8/07
to Django users

On Jul 6, 4:05 pm, Thomas Guettler <h...@tbz-pariv.de> wrote:
> Am Freitag, 6. Juli 2007 15:43 schrieb uxmal:
>
> > hello,
> > I know it isn't directly related to django, but well my django depends
> > on it...
>
> > yesterday I installed postgresql, mxBase, and psycopg 1.1 on openSUSE
> > 10.2,
> > and it worked fine until today (Django is really cool!).
>
> > using psycopg :
> > Error loading psycopg module: libpq.so.5: cannot open shared object
> > file: No such file or directory
>

>


> > But after upgrading it mysteriously decided to stop working...
>
> What kind of upgrade? (SuSE, Django, Hardware, ...)
>
> Thomas

I've made a SuSE upgrade

> This is the shared library provided by the postgres or postgres-devel
> RPM.
>
> It should be under /usr/lib or /usr/lib64.
>
> Starting the sql shell (psql) should fail, too.

It works fine, looking like nothing have changed on the postgresql
side

When I reinstall psycopg 1 or 2 (properly configured with my lib path /
usr/local/pgsql/lib/),
it works (no error at the install of psycopg)

but then it can't find this damn lib !

-----------------------------------------------------------
>>> import psycopg
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: libpq.so.5: cannot open shared object file: No such file
or directory
-----------------------------------------------------------
>>> import psycopg2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.5/site-packages/psycopg2/__init__.py",
line 60, in <module>
from _psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: libpq.so.5: cannot open shared object file: No such file
or directory
-----------------------------------------------------------

I don't understand how it can have changed after a simple software
upgrade...
Is there a possibility to change the path to the lib somewhere after
the install? (a conf file? )

thanks!

Thomas Guettler

unread,
Jul 9, 2007, 3:25:14 AM7/9/07
to django...@googlegroups.com

Look at /etc/ld.so.conf and "man ldconfig".

James Bennett

unread,
Jul 9, 2007, 3:43:52 AM7/9/07
to django...@googlegroups.com
On 7/6/07, uxmal <astrop...@gmail.com> wrote:
> using psycopg :
> Error loading psycopg module: libpq.so.5: cannot open shared object
> file: No such file or directory

PostgreSQL's libraries often install into a location where the default
ld configuration won't find them; locate the PostgreSQL 'lib'
directory on your system, and update the ld load path to include that
directory.

--
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

Reply all
Reply to author
Forward
0 new messages