From: Daniel Fetchinson on
> I make installed python 2.7 from source, and also installed the RPM version
> of cx_Oracle for python 2.7.
>
> But ldd tells me :
> #ldd cx_Oracle.so
> libpython2.7.so.1.0 => not found
>
> I find out that only libpython2.7.a generated when I install python2.7, who
> can tell me what I need to do ? I want a libpython2.7.so.1.0 generated when
>
>
> I install python.
>
> I am not familiar with GCC and .so .a stuff.

In this case I'd recommend removing the source install of python 2.7,
install it from rpm, followed by installing cx_Oracle from rpm.

HTH,
Daniel



--
Psss, psss, put it down! - http://www.cafepress.com/putitdown
From: Nils Ruettershoff on
Hi Jim,

Jim Qiu wrote:

[...]
> I find out that only libpython2.7.a generated when I install
> python2.7, who can tell me what I need to do ? I want a
> libpython2.7.so.1.0 generated when
>
I've didn't read your complete mail... In addition to the steps I've
described in my other mail, you need to the "configure" script, that you
like to have shared libraries.

So you need to add --enable-shared to your configure call:

../configure --prefix=/opt/Python2.7a --enable-shared

Now you got the shared libraries in the lib folder.

Cheers,
Nils
From: Nils Ruettershoff on
Hi Jim,

Jim Qiu wrote:
>
> I make installed python 2.7 from source, and also installed the RPM
> version of cx_Oracle for python 2.7.
>
> But ldd tells me :
> #ldd cx_Oracle.so
> libpython2.7.so.1.0 => not found
>
> I find out that only libpython2.7.a generated when I install
> python2.7, who can tell me what I need to do ? I want a
> libpython2.7.so.1.0 generated when
>

[...]

Due to the fact that you have compiled python from source, the python
library is not in the defaul library path. Due to that the lib can't be
found.

As a quick workourd you can extend the LD_LIBRARY_PATH variable with the
path and check if cx_Orcacle get now the lib. Lets assume you
"installed" python at /opt/Python2.7a, then you need to extend the
variable in this way:

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/Python2.7a/lib"

afterwards do the ldd again and check if the lib could be found now. If
not, you've got the wrong path.

Now you need to perist the changed library path.

For this, you need to be root:

1. echo "/opt/Python2.7a/lib" > /etc/ld.so.conf.d/Pathon2.7a.conf
2. refresh your shared library cache with "ldconfig"

Now you OS knows the new library location.

But this is not clean. As Daniel mention, you should try to get a rpm.
Otherwise you may get in trouble, if you install a newer Python2.7
version and forget to maintain you library paths.

Cheers,
Nils