471,578 Members | 1,513 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,578 software developers and data experts.

Error with Python 2.3 as a shared Library

Hi, perhaps some of you can help me...

I'm installing Python 2.3 (in Linux RedHat 8.0) and I need to build it
like a shared library, because I want to interact
Python with PostgreSQL. Following the README instructions, I try:

../configure --enable-shared --prefix=/whatever (I'm not root of my
system, so I can't use /usr/local/)
make
make install

it seems to be ok, without errors. And when I try :

/whatever/bin/python

it says:

whatever/bin/python error while loading shared libraries:
libpython2.3.so.1.0: cannot open shared object file: No such file or
directory

but this library (libpython2.3.so.1.0 ) is in the whatever/lib directory.

What's wrong? Is it something related to the path? How can I tell python
where the library is? Or is it not the problem?

Thanks.
Jul 18 '05 #1
1 2484
You need to add /whatever/lib to the path for searching .so files.
If you are root, normally you may edit /etc/ld.so.conf to add the path permanently.
If you are not root, you can set the environment variable LD_LIBRARY_PATH:

for sh: export LD_LIBRARY_PATH=/whatever/lib
for csh: setenv LD_LIBRARY_PATH /whatever/lib

or simply use the env command:

env LD_LIBRARY_PATH=/whatever/lib python

Note that this is nothing special to python but normal behaviour of Linux or Linux like operating systems including many Unices.

Regards,
Kiyo

"Francisco Miguel Montenegro Montes" <fm*@cca.iac.es> wrote in message news:ma*********************************@python.or g...
Hi, perhaps some of you can help me...

I'm installing Python 2.3 (in Linux RedHat 8.0) and I need to build it
like a shared library, because I want to interact
Python with PostgreSQL. Following the README instructions, I try:

./configure --enable-shared --prefix=/whatever (I'm not root of my
system, so I can't use /usr/local/)
make
make install

it seems to be ok, without errors. And when I try :

/whatever/bin/python

it says:

whatever/bin/python error while loading shared libraries:
libpython2.3.so.1.0: cannot open shared object file: No such file or
directory

but this library (libpython2.3.so.1.0 ) is in the whatever/lib directory.

What's wrong? Is it something related to the path? How can I tell python
where the library is? Or is it not the problem?

Thanks.

Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Ixokai | last post: by
1 post views Thread by Ram | last post: by
113 posts views Thread by John Nagle | last post: by
2 posts views Thread by akhilesh.noida | last post: by
20 posts views Thread by timotoole | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
1 post views Thread by lumer26 | last post: by
reply views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.