2

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.

catfour
  • 119
  • 3
  • 10
  • Please post the full error – FlyingTeller Jan 24 '20 at 15:14
  • @FlyingTeller It's too long, I'll past some important lines of errors: cl : Command line warning D9002 : ignoring unknown option '-std=c++17' Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION fatal error C1083: Cannot open include file: 'rubberband/RubberBandStretcher.h': No such file or directory ERROR: Failed building wheel for rubberband – catfour Jan 24 '20 at 16:43

4 Answers4

1

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

phd
  • 82,685
  • 13
  • 120
  • 165
  • 1
    Yes I tried that, but it gives the following error: "RuntimeError: Failed to execute rubberband. Please verify that rubberband-cli is installed.", and I tried to install rubberband-cli as the following: `pip install rubberband-cli`, and it gives the following error: "ERROR: Could not find a version that satisfies the requirement rubberband-cli (from versions: none) ERROR: No matching distribution found for rubberband-cli". So how to solve that? – catfour Jan 24 '20 at 16:38
  • You need to install `rubberband`. It's not a Python package, you cannot install it with `pip`. See update in the answer. – phd Jan 24 '20 at 19:25
  • I read your link, there is no obvious way how to install rubberband on Windows so that we can use pyrubberband in Python code without the mentioned error. Thank you. – catfour Jan 25 '20 at 06:02
  • @catfour you need to add the directory which has `rubberband.exe` and `libsndfile-1.dll` to your [PATH environment variable](https://stackoverflow.com/questions/44272416/how-to-add-a-folder-to-path-environment-variable-in-windows-10-with-screensho). I have it installed here: `C:\Program Files\rubberband-1.8.2-gpl-executable-windows`. You could alternatively just add those 2 files to a directory which is already in your PATH. – GordonAitchJay Mar 20 '20 at 05:06
0

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.
  • Does `-dev` unstable, being developed package? – Jun Sep 17 '21 at 00:41
  • 1
    No, it just means the said package contains header files in addition to executables, so that you’re able to depend on it during development. Read here: https://stackoverflow.com/questions/3588164/the-dev-suffix-in-package-names – Jonathan Monsonego Sep 18 '21 at 08:31
0

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

$ brew install rubberband

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

axelmukwena
  • 779
  • 7
  • 24
0

Install "rubberband-cli" Package on Ubuntu:

sudo apt-get update -y
sudo apt-get install -y rubberband-cli
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77