473,473 Members | 2,193 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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
Jul 18 '05 #1
5 6847
ju************@hotmail.com (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
Jul 18 '05 #2
> 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.

Jul 18 '05 #3
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

Jul 18 '05 #4
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 <je****@unpythonic.net> wrote in message news:<ma**********************************@python. org>...
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

Jul 18 '05 #5
On 13 Jul 2003 15:34:36 -0700, ju************@hotmail.com (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/doc...ary-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 -

Jul 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

220
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have...
17
by: Jan Danielsson | last post by:
Hello all, I recently started using Python, and I must say I like it. Both the language and libraries available for it. Background: I have written an application which I use to keep track of...
5
by: jgelfand | last post by:
I'm installing Python 2.4.4 on a CentOS release 4.6 (Final) 64-bit machine. Running "./configure --prefix="/ usr/local/yosi/ciao-4.0/ots" --enable-shared" appears to be fine, but I get the...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.