problems trying to build python 2.6 as a shared library

Marco Nawijn nawijn at gmail.com
Fri Sep 25 07:36:28 EDT 2009


On Sep 25, 1:08 pm, Chris Withers <ch... at simplistix.co.uk> 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



More information about the Python-list mailing list