1

I have recently started working in linux, I wanted to to add ALSA module in my Python. I have used this,

sudo apt-get install libasound2-dev

After that I've installed pyalsa package,

pyalsa installation,
wget ftp://ftp.alsa-project.org/pub/pyalsa/pyalsa-1.0.14rc3.tar.bz2

tar xf pyalsa-1.0.14rc3.tar.bz2

$ python setup.py build

# python setup.py install

but when I type help(alsaaudio) in the Python, it gives error that there is no such module

According to the alsaaudio, (http://pyalsaaudio.sourceforge.net/pyalsaaudio.html)

Note: the wrappers link with the alsasound library (from the alsa-lib package) and need the ALSA headers for compilation. Verify that you have /usr/lib/libasound.so and /usr/include/alsa (or similar paths) before building.

I do not understand what does that mean and what I am doing wrong in adding Alsa module in Python.

  • You don't need to do that. Read INSTALL again. – Ignacio Vazquez-Abrams Sep 29 '13 at 8:28
  • "I wanted to install ALSA inside my python". Sorry, I don't understand what this means. Can you clarify/elaborate? – Faheem Mitha Sep 29 '13 at 9:18
3

It doesn't need to python setup.py build , When you download by hand a module you should do it, however if you use install pip system , you don't need to use the given command.

in debian-base systems you can see the following formula:

python-modulename #python2 
python3-modulename #python3

But if you didn't find in debian repository, you can download by or without dowunlowd just use:

pip install yourmoudle
pip3 install yourmodule

before pip system programmers used easy_install.

  • I had the same problem on Ubuntu 14.04. To answer the original question, you also have to install the Python headers: sudo apt-get install libpython2.7-dev – Andrew Jessop May 25 '16 at 20:59
4

python-pyalsa is available in Debian for wheezy/testing/unstable. You don't need to build/install from source.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.