Python 3.6: how to install rubberband?

4.8k views Asked by At

I want to use this function, and I'm trying to install rubberband using pip as the following: pip install rubberband

But, it raises the following error: "Failed building wheel for rubberband"

And I can't use Python 3.5 in my project. So, how to install rubberband?

P.S. My OS is Windows 10, and I have python 3.6 on it.

4

There are 4 answers

4
phd On

The docs you pointed to are the docs for the project pyrubberband, not rubberband. So install it with pip install pyrubberband.

As for rubberband: you probably need a C/C++ compiler to install it.

Upd. pyrubberband is a Python wrapper for rubberband. You need to install it, see https://breakfastquay.com/rubberband/index.html

2
Jonathan Monsonego On

To make a long story short, this is how I installed the rubberband python package.

  1. apt update
  2. apt-get install libsndfile-dev
  3. apt-get install librubberband-dev
  4. python3 -m pip install numpy (required for rubberband)

Note that the -dev postfix is required to get the header files that are later required for the python rubberband package to be able to compile the package.

Later, pip install rubberband failed on transform is not a member of std. To solve that, I did the following:

  1. python3 -m pip download rubberband
  2. tar -xf rubberband-1.0.2.tar.gz
  3. edit rubberband-1.0.2/src/numpy.cpp - add #include <algorithm> at the top of the file.
  4. cd rubberband-1.0.2 and then run python3 -m pip install . or better yet python setup.py bdist_wheel --universal to create a whl file to add to your docker dependencies.
2
axelmukwena On

If you ran through this and using macOS, brew for everything works

$ brew install rubberband

Works like charm https://formulae.brew.sh/formula/rubberband

2
arash hemati On

Install "rubberband-cli" Package on Ubuntu:

sudo apt-get update -y
sudo apt-get install -y rubberband-cli