installing python library modules (general question)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Julia Goolia

    installing python library modules (general question)

    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
  • Martin v. Löwis

    #2
    Re: installing python library modules (general question)

    juliagoolia301@ hotmail.com (Julia Goolia) writes:
    [color=blue]
    > 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.[/color]

    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.
    [color=blue]
    > 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.[/color]

    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

    Comment

    • Lee Harr

      #3
      Re: installing python library modules (general question)

      > ImportError: libmad.so.0: cannot open shared object file: No such file[color=blue]
      > 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.
      >[/color]


      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.

      Comment

      • Jeff Epler

        #4
        Re: installing python library modules (general question)

        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

        Comment

        • Julia Goolia

          #5
          Re: installing python library modules (general question)

          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 <jepler@unpytho nic.net> wrote in message news:<mailman.1 058113998.31950 [email protected] >...[color=blue]
          > 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[/color]

          Comment

          • Matthias Baas

            #6
            Re: installing python library modules (general question)

            On 13 Jul 2003 15:34:36 -0700, juliagoolia301@ hotmail.com (Julia
            Goolia) wrote:[color=blue]
            >you so much. just so i know... adding something to /etc/ld/so/conf is
            >different than setting LD_LIBRARY_PATH ?[/color]

            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):



            (this and more documentation can be found at "The Linux Documentation
            Project": http://www.tldp.org/)
            [color=blue]
            >what do you do if you don't ave root access?[/color]

            Then you actually do use LD_LIBRARY_PATH .

            - Matthias -

            Comment

            Working...