Re: source install of python2.7 and rpm install of cx_Oracle collision

Discussion in 'Python' started by Nils Ruettershoff, Jul 22, 2010.

  1. 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
    Nils Ruettershoff, Jul 22, 2010
    #1
    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. Scott Chapman
    Replies:
    0
    Views:
    353
    Scott Chapman
    Oct 3, 2003
  2. Cliff Wells
    Replies:
    1
    Views:
    342
    Paul Boddie
    Oct 13, 2003
  3. Zhi Min
    Replies:
    0
    Views:
    402
    Zhi Min
    Jun 11, 2004
  4. Nils Ruettershoff
    Replies:
    0
    Views:
    487
    Nils Ruettershoff
    Jul 22, 2010
  5. Steven W. Orr
    Replies:
    1
    Views:
    275
    Steven W. Orr
    Mar 4, 2011
Loading...

Share This Page