Error with Python 2.3 as a shared Library

Discussion in 'Python' started by Francisco Miguel Montenegro Montes, Aug 14, 2003.

  1. 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.
     
    Francisco Miguel Montenegro Montes, Aug 14, 2003
    #1
    1. Advertising

  2. 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" <> wrote in message news:...
    > 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.
    >
    >
     
    Kiyo Kelvin Lee, Aug 14, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DJ Dev
    Replies:
    3
    Views:
    16,133
    Gandalf
    Feb 8, 2004
  2. hab
    Replies:
    2
    Views:
    474
    Donn Cave
    Jul 7, 2003
  3. Douglass Turner
    Replies:
    2
    Views:
    2,043
    Manfred Bartz
    Sep 4, 2003
  4. Replies:
    1
    Views:
    1,279
    santosh
    Jul 15, 2008
  5. DJ Stunks
    Replies:
    0
    Views:
    329
    DJ Stunks
    Feb 10, 2007
Loading...

Share This Page