Unable to install SimpleAudio with Conda or Pip
Asked Answered
D

1

5

I am trying to install SimpleAudio with Conda although I run into errors. I then try Pip and get a different error. I am running Raspbian Buster on the Raspberry Pi 4 with python version 3.6.6. Conda version 4.5.1. Pip version 18.0. Processor is ARM Cortex-A72.

I use to the following to install SimpleAudio:

conda install -c skmad simpleaudio

I then recieve the following error:

Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  - simpleaudio

Current channels:

  - https://conda.anaconda.org/skmad/linux-armv7l
  - https://conda.anaconda.org/skmad/noarch
  - https://conda.anaconda.org/rpi/linux-armv7l
  - https://conda.anaconda.org/rpi/noarch
  - https://repo.anaconda.com/pkgs/main/linux-armv7l
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/free/linux-armv7l
  - https://repo.anaconda.com/pkgs/free/noarch
  - https://repo.anaconda.com/pkgs/r/linux-armv7l
  - https://repo.anaconda.com/pkgs/r/noarch
  - https://repo.anaconda.com/pkgs/pro/linux-armv7l
  - https://repo.anaconda.com/pkgs/pro/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

I recieve this error despite the script I run being suggested on the Annaconda website.

I then try the generic pip install (which finds the correct package) and get the following process and error message:

pi@raspberrypi:~ $ pip install simpleaudio

Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting simpleaudio
  Using cached https://files.pythonhosted.org/packages/94/1b/4dc29653733202b68c09d9c6ca085cf67ac54859ee860647ef21ac1ff3dc/simpleaudio-1.0.4.tar.gz
Building wheels for collected packages: simpleaudio
  Running setup.py bdist_wheel for simpleaudio ... error
  Complete output from command /home/pi/miniconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ll1gm7ko/simpleaudio/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-u1mh9fbx --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-armv7l-3.6
  creating build/lib.linux-armv7l-3.6/simpleaudio
  copying simpleaudio/__init__.py -> build/lib.linux-armv7l-3.6/simpleaudio
  copying simpleaudio/shiny.py -> build/lib.linux-armv7l-3.6/simpleaudio
  copying simpleaudio/functionchecks.py -> build/lib.linux-armv7l-3.6/simpleaudio
  creating build/lib.linux-armv7l-3.6/simpleaudio/test_audio
  copying simpleaudio/test_audio/c.wav -> build/lib.linux-armv7l-3.6/simpleaudio/test_audio
  copying simpleaudio/test_audio/e.wav -> build/lib.linux-armv7l-3.6/simpleaudio/test_audio
  copying simpleaudio/test_audio/g.wav -> build/lib.linux-armv7l-3.6/simpleaudio/test_audio
  copying simpleaudio/test_audio/left_right.wav -> build/lib.linux-armv7l-3.6/simpleaudio/test_audio
  copying simpleaudio/test_audio/notes_2_16_44.wav -> build/lib.linux-armv7l-3.6/simpleaudio/test_audio
  running build_ext
  building 'simpleaudio._simpleaudio' extension
  creating build/temp.linux-armv7l-3.6
  creating build/temp.linux-armv7l-3.6/c_src
  gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -I/home/pi/miniconda3/include -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard -fPIC -O2 -pipe -I/home/pi/miniconda3/include -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard -fPIC -O2 -pipe -fPIC -DDEBUG=0 -I/home/pi/miniconda3/include/python3.6m -c c_src/simpleaudio_alsa.c -o build/temp.linux-armv7l-3.6/c_src/simpleaudio_alsa.o
  c_src/simpleaudio_alsa.c:8:10: fatal error: alsa/asoundlib.h: No such file or directory
   #include <alsa/asoundlib.h>
            ^~~~~~~~~~~~~~~~~~
  compilation terminated.
  error: command 'gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for simpleaudio
  Running setup.py clean for simpleaudio
Failed to build simpleaudio
Installing collected packages: simpleaudio
  Running setup.py install for simpleaudio ... error
    Complete output from command /home/pi/miniconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ll1gm7ko/simpleaudio/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-fmdsq71s/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-armv7l-3.6
    creating build/lib.linux-armv7l-3.6/simpleaudio
    copying simpleaudio/__init__.py -> build/lib.linux-armv7l-3.6/simpleaudio
    copying simpleaudio/shiny.py -> build/lib.linux-armv7l-3.6/simpleaudio
    copying simpleaudio/functionchecks.py -> build/lib.linux-armv7l-3.6/simpleaudio
    creating build/lib.linux-armv7l-3.6/simpleaudio/test_audio
    copying simpleaudio/test_audio/c.wav -> build/lib.linux-armv7l-3.6/simpleaudio/test_audio
    copying simpleaudio/test_audio/e.wav -> build/lib.linux-armv7l-3.6/simpleaudio/test_audio
    copying simpleaudio/test_audio/g.wav -> build/lib.linux-armv7l-3.6/simpleaudio/test_audio
    copying simpleaudio/test_audio/left_right.wav -> build/lib.linux-armv7l-3.6/simpleaudio/test_audio
    copying simpleaudio/test_audio/notes_2_16_44.wav -> build/lib.linux-armv7l-3.6/simpleaudio/test_audio
    running build_ext
    building 'simpleaudio._simpleaudio' extension
    creating build/temp.linux-armv7l-3.6
    creating build/temp.linux-armv7l-3.6/c_src
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -I/home/pi/miniconda3/include -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard -fPIC -O2 -pipe -I/home/pi/miniconda3/include -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard -fPIC -O2 -pipe -fPIC -DDEBUG=0 -I/home/pi/miniconda3/include/python3.6m -c c_src/simpleaudio_alsa.c -o build/temp.linux-armv7l-3.6/c_src/simpleaudio_alsa.o
    c_src/simpleaudio_alsa.c:8:10: fatal error: alsa/asoundlib.h: No such file or directory
     #include <alsa/asoundlib.h>
              ^~~~~~~~~~~~~~~~~~
    compilation terminated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/home/pi/miniconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ll1gm7ko/simpleaudio/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-fmdsq71s/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-ll1gm7ko/simpleaudio/

Does anyone have any suggestions?

Thanks

Disrepute answered 13/2, 2020 at 18:5 Comment(4)
What platform? Processor architecture? OS? Python version?Picayune
failed building wheel for simpleaudio is a generic error and printed on every installation failure. You have to post the complete install log.Decalogue
Sorry I will update the post. I am running Raspbian Buster on the Raspberry Pi 4 with python version 3.6.6. Conda version 4.5.1. Pip version 18.0. Processor is ARM Cortex-A72.Disrepute
I will update the post with the full install log for the installation failure.Disrepute
D
15

This was resolved by installing the dependencies required before using Pip.

Use the below script:

sudo apt-get install -y python3-dev libasound2-dev
Disrepute answered 19/2, 2020 at 16:40 Comment(3)
thanks for the information to install some pluginGreengrocer
I was unable to install simpleaudoio in ubuntu 20.04 recently, using this solved my problemSharonsharona
thank you, this solved the issue. could you share a few pointers how did you find out it was this package since the error message nowhere mentioned it ?Mendive

© 2022 - 2024 — McMap. All rights reserved.