Wednesday, October 31, 2007

How to install pymedia on Ubuntu (Gutsy)

"Pymedia is a Python library for accessing and manipulating media files. It makes audio and video playback/creation a snap for even a newcomer to programming." There is a deb installer available for pymedia 1.3.5 but not for 1.3.7 So I decided to write this howto.

First install all the dependencies:
sudo apt-get install python-dev libogg-dev libvorbis-dev liblame-dev libfaad2-dev libasound2-dev python-pygame
(Pygame is not really necessary, but recommended.)

Extract a download of pymedia-*.tgz and open a terminal in the extracted folder, so we can build pymedia:
python build

This should display:
Using UNIX configuration...

OGG : found
VORBIS : found
FAAD : found
MP3LAME : found
ALSA : found
Continue building pymedia ? [Y,n]:

If everything is found press Y

Finally install pymedia:
sudo python install

Test if pymedia installed correctly by typing this at the python shell:
import pymedia

You may now proceed to the pymedia tutorials.


  1. I there Stani, it's Marco.

    An even better way to intall it is through a .deb, witch.. i've built a long time ago.
    It's for python 2.4, but I could package it for the newer 2.5 if needed.

    Find me on jabber if you want it.


  2. Actually, I'd like to see more recent build of the pymedia packaged as .deb. I've been trying to build this module here but I keep getting compiler errors. I'm currently stuck at the following error message: "/usr/bin/ld: build/temp.linux-x86_64-2.5/sound/sound.o: relocation R_X86_64_32 against `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC
    build/temp.linux-x86_64-2.5/sound/sound.o: could not read symbols: Bad value"


  3. Anyone think there might be a kubuntu package coming along?

  4. Thanks for the guide! I had trouble installing on Ubuntu 8.04 and Python 2.5, so I wrote a follow up guide:

  5. I'm getting the same error as shandread,


Filter by topic: spe, python, ubuntu