psycopg2 error

L

Luis P. Mendes

Hi,

I've installed psycopg2 under Slacware 11.0 along with PostgreSQL 8.2.4.

When I run the python shell I get the following error: lupe@lince ~$
python
Python 2.4.3 (#1, Jul 26 2006, 20:13:39) [GCC 3.4.6] on linux2 Type
"help", "copyright", "credits" or "license" for more information.Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.4/site-packages/psycopg2/__init__.py", line 60,
in ?
from _psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: libpq.so.5: cannot open shared object file: No such file or
directory

The strange thing is that under root and postgres users, there is no
error. postgres@lince ~$ python
Python 2.4.3 (#1, Jul 26 2006, 20:13:39) [GCC 3.4.6] on linux2 Type
"help", "copyright", "credits" or "license" for more information.libpq files are readable by the world: root@lince pgsql # ll lib/ -d
drwxr-xr-x 3 postgres postgres 1528 2007-05-07 23:25 lib/

root@lince lib # ll libpq*
-rw-r--r-- 1 postgres postgres 155858 2007-05-07 23:25 libpq.a lrwxrwxrwx
1 postgres postgres 12 2007-05-07 23:25 libpq.so -> libpq.so.5.0
lrwxrwxrwx 1 postgres postgres 12 2007-05-07 23:25 libpq.so.5 ->
libpq.so.5.0 -rwxr-xr-x 1 postgres postgres 126496 2007-05-07 23:25
libpq.so.5.0

The postgreSQL lib is in ld.so.conf and ldconfig has been run: # cat
/etc/ld.so.conf
/usr/local/lib
/usr/X11R6/lib
/usr/i486-slackware-linux/lib
/opt/kde/lib
/usr/lib/qt/lib
/usr/local/pgsql/lib

What is wrong?


Luis
 
?

=?ISO-8859-15?Q?=22Martin_v=2E_L=F6wis=22?=

ImportError: libpq.so.5: cannot open shared object file: No such file or
directory

libpq files are readable by the world: root@lince pgsql # ll lib/ -d
drwxr-xr-x 3 postgres postgres 1528 2007-05-07 23:25 lib/

Don't try this as the root user, but as the one for whom it is failing:
What does "file /usr/local/psql/lib/libpq.so.5" say?
The postgreSQL lib is in ld.so.conf and ldconfig has been run:

What is wrong?

So what does "/sbin/ldconfig -p" say, when run as the user for whom
it is failing?

Regards,
Martin
 
L

Luis P. Mendes

Hello Martin,

Em Wed, 09 May 2007 06:17:09 +0200, Martin v. Löwis escreveu:
Don't try this as the root user, but as the one for whom it is failing:
What does "file /usr/local/psql/lib/libpq.so.5" say?
The problem was that I couldn't issue this command. Permissions were set
incorrectly:
$ ll /usr/local/pg* -d
drwxr-x--- 10 postgres postgres 712 2007-05-08 20:43 /usr/local/pgsql

Once corrected to:
$ ll /usr/local/pg* -d
drwxr-xr-x 10 postgres postgres 712 2007-05-08 20:43 /usr/local/pgsql

I can import psycopg2 fine.

Thank you for your help!

Best regards,

Luis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top