problems trying to build python 2.6 as a shared library

Discussion in 'Python' started by Chris Withers, Sep 25, 2009.

  1. Hi All,

    I'm trying to build Python 2.6 as a shared library, so I did:

    ./configure --enable-shared
    make
    make altinstall

    No obvious signs of failure, but when I try and use the resulting
    python, I get:

    python2.6: error while loading shared libraries: libpython2.6.so.1.0:
    cannot open shared object file: No such file or directory

    Why might that be?

    cheers,

    Chris

    --
    Simplistix - Content Management, Batch Processing & Python Consulting
    - http://www.simplistix.co.uk
    Chris Withers, Sep 25, 2009
    #1
    1. Advertising

  2. Chris Withers

    Marco Nawijn Guest

    On Sep 25, 1:08 pm, Chris Withers <> wrote:
    > Hi All,
    >
    > I'm trying to build Python 2.6 as a shared library, so I did:
    >
    >    ./configure --enable-shared
    >    make
    >    make altinstall
    >
    > No obvious signs of failure, but when I try and use the resulting
    > python, I get:
    >
    > python2.6: error while loading shared libraries: libpython2.6.so.1.0:
    > cannot open shared object file: No such file or directory
    >
    > Why might that be?
    >
    > cheers,
    >
    > Chris
    >
    > --
    > Simplistix - Content Management, Batch Processing & Python Consulting
    >             -http://www.simplistix.co.uk


    Hello Chris,

    The dynamic loader cannot find the python shared library. There are
    at least 2 options:
    1. Add path that contains the shared library to the
    LD_LIBRARY_PATH environment variable. In a bash shell this can be
    accomplished by: export LD_LIBRARY_PATH=/path/to/python_shared_lib:
    $LD_LIBRARY_PATH
    2. Add path to dynamic linker configuration file. This typically
    is in '/etc/ld.so.conf'. See man page for ld for more information.

    Note that I assumed that you are on a Unix/Linux machine.

    Regards,

    Marco
    Marco Nawijn, Sep 25, 2009
    #2
    1. Advertising

  3. Marco Nawijn wrote:
    > 2. Add path to dynamic linker configuration file. This typically
    > is in '/etc/ld.so.conf'. See man page for ld for more information.


    Yes, this was it.
    Don't forget to run ldconfig after you've changed /etc/ld.so.conf

    It's frustrating how the contents of this file vary from distro to
    distro, particularly w.r.t. /usr/local/lib :-(

    Chris

    --
    Simplistix - Content Management, Batch Processing & Python Consulting
    - http://www.simplistix.co.uk
    Chris Withers, Sep 30, 2009
    #3
  4. Chris Withers

    Guest

    On Friday, 25 September 2009 04:36:28 UTC-7, Marco Nawijn wrote:
    > On Sep 25, 1:08 pm, Chris Withers <> wrote:
    > > Hi All,
    > >
    > > I'm trying to build Python 2.6 as a shared library, so I did:
    > >
    > >    ./configure --enable-shared
    > >    make
    > >    make altinstall
    > >
    > > No obvious signs of failure, but when I try and use the resulting
    > > python, I get:
    > >
    > > python2.6: error while loading shared libraries: libpython2.6.so.1.0:
    > > cannot open shared object file: No such file or directory
    > >
    > > Why might that be?
    > >
    > > cheers,
    > >
    > > Chris
    > >
    > > --
    > > Simplistix - Content Management, Batch Processing & Python Consulting
    > >             -http://www.simplistix.co.uk

    >
    > Hello Chris,
    >
    > The dynamic loader cannot find the python shared library. There are
    > at least 2 options:
    > 1. Add path that contains the shared library to the
    > LD_LIBRARY_PATH environment variable. In a bash shell this can be
    > accomplished by: export LD_LIBRARY_PATH=/path/to/python_shared_lib:
    > $LD_LIBRARY_PATH
    > 2. Add path to dynamic linker configuration file. This typically
    > is in '/etc/ld.so.conf'. See man page for ld for more information.
    >
    > Note that I assumed that you are on a Unix/Linux machine.
    >
    > Regards,
    >
    > Marco


    Could you elaborate on this for a Linux newbie please? I carried out step 1with no problems, but when I view /etc/ld.so.conf, I get the following:

    $ cat /etc/ld.so.conf
    include ld.so.conf.d/*.conf

    I don't know how to use ld - I see from the man pag that it's used for linking files, but I don't know (in this context) what files I want to be linking to what.

    I've copied libpython2.7.so and libpython2.7.so.1.0 to the folder in $LD_LIBRARY_PATH, meaning I don't get the problems detailed in the original post anymore, but I'm concerned that I'm sticking a plaster over a bigger problem.
    , Jan 19, 2013
    #4
    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. Becky
    Replies:
    2
    Views:
    452
    Roedy Green
    Apr 7, 2006
  2. Brent White
    Replies:
    4
    Views:
    624
    John Saunders [MVP]
    Jul 19, 2007
  3. Replies:
    1
    Views:
    1,249
    santosh
    Jul 15, 2008
  4. octopusgrabbus

    Re-installing 2.6.6 to build shared library

    octopusgrabbus, Feb 4, 2011, in forum: Python
    Replies:
    0
    Views:
    208
    octopusgrabbus
    Feb 4, 2011
  5. DJ Stunks
    Replies:
    0
    Views:
    313
    DJ Stunks
    Feb 10, 2007
Loading...

Share This Page