installing python library modules (general question)

Discussion in 'Python' started by Julia Goolia, Jul 13, 2003.

  1. Julia Goolia

    Julia Goolia Guest

    Hi,

    I'm sure this issue has been brought up a billion times... but I'm
    having trouble installing a python module. I have read all the
    documentation for all the buzz words I know related to this problem
    but to no avail.

    Basically I downloaded a python module called pymad. This module is
    supposed to be simplified API to libmad (an mp3 decoder) (I want to
    play mp3's from python).

    I installed libmad. The libraries appear to be in /usr/local/lib. I
    did all the distutils stuff for the module. Now when I try to "import
    mad" I get an ImportError exception:

    ImportError: libmad.so.0: cannot open shared object file: No such file
    or directory

    I know the file /usr/local/lib/libmad.so.0 exists, but python can't
    seem to find it. I tried adding this path to LD_LIBRARY_PATH, but
    that didn't help.

    I guess that I just really dont' know enought about libraries and
    linux (redhat 9). I don't really know where they are supposed to go
    after being compiled, and how python "loads" and uses them.

    Any help is much appreciated,
    Julia
     
    Julia Goolia, Jul 13, 2003
    #1
    1. Advertising

  2. (Julia Goolia) writes:

    > ImportError: libmad.so.0: cannot open shared object file: No such file
    > or directory
    >
    > I know the file /usr/local/lib/libmad.so.0 exists, but python can't
    > seem to find it. I tried adding this path to LD_LIBRARY_PATH, but
    > that didn't help.


    Can you please be precise on what "this path" is? Adding
    "/usr/local/lib/libmad.so.0" would be wrong, whereas adding
    "/usr/local/lib" should work.

    > I guess that I just really dont' know enought about libraries and
    > linux (redhat 9). I don't really know where they are supposed to go
    > after being compiled, and how python "loads" and uses them.


    You might also edit /etc/ld.so.conf to add /usr/local/lib, and run
    ldconfig afterwards; this would remove the need to set LD_LIBRARY_PATH

    HTH,
    Martin
     
    Martin v. =?iso-8859-15?q?L=F6wis?=, Jul 13, 2003
    #2
    1. Advertising

  3. Julia Goolia

    Lee Harr Guest

    > ImportError: libmad.so.0: cannot open shared object file: No such file
    > or directory
    >
    > I know the file /usr/local/lib/libmad.so.0 exists, but python can't
    > seem to find it. I tried adding this path to LD_LIBRARY_PATH, but
    > that didn't help.
    >
    > I guess that I just really dont' know enought about libraries and
    > linux (redhat 9). I don't really know where they are supposed to go
    > after being compiled, and how python "loads" and uses them.
    >



    Where are your other python libraries? On my system, they are in:

    /usr/local/lib/python2.2/

    and then modules that get added by distutils go in:

    /usr/local/lib/python2.2/site-packages/

    I have a bunch of libfoo.so and libbaz.so.1 type files in there, so
    I think if you have a directory like that you should try dropping
    your libmad.so.0 in there.
     
    Lee Harr, Jul 13, 2003
    #3
  4. Julia Goolia

    Jeff Epler Guest

    Add /usr/local/lib to the list of directories in /etc/ld.so.conf and
    then execute /sbin/ldconfig to create some needed symlinks in
    /usr/local/lib.

    Jeff
     
    Jeff Epler, Jul 13, 2003
    #4
  5. Julia Goolia

    Julia Goolia Guest

    jeff,

    you are a gentleman and a scholar. that worked like a charm. thank
    you so much. just so i know... adding something to /etc/ld/so/conf is
    different than setting LD_LIBRARY_PATH? what do you do if you don't
    have root access?

    thanks again,
    julia

    Jeff Epler <> wrote in message news:<>...
    > Add /usr/local/lib to the list of directories in /etc/ld.so.conf and
    > then execute /sbin/ldconfig to create some needed symlinks in
    > /usr/local/lib.
    >
    > Jeff
     
    Julia Goolia, Jul 13, 2003
    #5
  6. On 13 Jul 2003 15:34:36 -0700, (Julia
    Goolia) wrote:
    >you so much. just so i know... adding something to /etc/ld/so/conf is
    >different than setting LD_LIBRARY_PATH?


    The result should actually be the same. Maybe there was a typo when
    you set the path in LD_LIBRARY_PATH, this can easily happen (see
    above, the config file is actually /etc/ld.so.conf.... ;-)

    By the way, if you want to know how loading libraries works, have a
    look at this HOWTO (section 3):

    http://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/html_single/Program-Library-HOWTO.html

    (this and more documentation can be found at "The Linux Documentation
    Project": http://www.tldp.org/)

    >what do you do if you don't ave root access?


    Then you actually do use LD_LIBRARY_PATH.

    - Matthias -
     
    Matthias Baas, Jul 18, 2003
    #6
    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. Noah
    Replies:
    0
    Views:
    294
  2. Robin Haswell
    Replies:
    13
    Views:
    492
    Frank Millman
    Jan 20, 2006
  3. nrolland
    Replies:
    1
    Views:
    101
    George Ogata
    Dec 4, 2006
  4. Mario Ruiz
    Replies:
    10
    Views:
    222
    Mario Ruiz
    Mar 13, 2008
  5. oleg korenevich
    Replies:
    4
    Views:
    443
    Mel Wilson
    Feb 2, 2012
Loading...

Share This Page