0

I'm attempting to use rubberband and coming across errors I haven't seen before, nor know how to resolve.

First, I installed via terminal with both pip and pip3. rubberband appears in pip freeze and pip3 freeze as version 0.2.0.

When I import rubberband the python editor in terminal, the common error is returned:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named rubberband

When I import rubberband the python3 editor in terminal, the unusual error is returned. (This error also appears during import in jupyter notebook):

>>> import rubberband
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/rubberband.cpython-37m-darwin.so, 2): Library not loaded: /usr/local/lib/libsndfile.1.dylib
  Referenced from: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/rubberband.cpython-37m-darwin.so
  Reason: image not found

I think it is notable that import in python and python3 returns different error messages. From there, I am having trouble troubleshooting.

Thanks in advance!

Edit: Tharun K commented to check the dependencies: librubberband and libsndfile. Below are the error messages returned when attempting to install librubberband. (same errors applied for libsndfile)

$ pip3 install librubberband
ERROR: Could not find a version that satisfies the requirement librubberband (from versions: none)
ERROR: No matching distribution found for librubberband
$ python3 -m pip install "librubberband==1.8"
ERROR: Could not find a version that satisfies the requirement librubberband==1.8 (from versions: none)
ERROR: No matching distribution found for librubberband==1.8
$ python3 -m pip install "librubberband~=1.8"
ERROR: Could not find a version that satisfies the requirement librubberband~=1.8 (from versions: none)
ERROR: No matching distribution found for librubberband~=1.8

Edit 2: Solution from Tharun K "Michael, firstly, I'd mentioned libsamplerate and libsndfil formulae.brew.sh/formula/libsndfile formulae.brew.sh/formula/libsamplerate – Tharun K"

libsamplerate and libsndfil needed to be installed with brew.

  • have you installed `libsamplerate` and `libsndfile` – Tharun K May 06 '21 at 15:03
  • thank you Tharun, i tried to install the dependencies, but still did not work. I edited the main post to include the error messages for the various methods I attempted. – Michael Korn May 07 '21 at 14:38
  • Michael, firstly, I'd mentioned `libsamplerate` and not `librubberband`. Secondly, you have to install them using brew https://formulae.brew.sh/formula/libsndfile https://formulae.brew.sh/formula/libsamplerate – Tharun K May 08 '21 at 05:19
  • The brew install for libsamplerate and libsndfile did the trick! Thank you so much! – Michael Korn May 09 '21 at 16:07

2 Answers2

1

You can try the solution:

Source : https://github.com/bmcfee/pyrubberband/issues/18#issuecomment-786515163

  1. Download rubberband library ( folder containing rubberband.exe and libsndfile-1.dll
  2. Go to Windows System Environment and Add the folder to Path
  3. Create System Variable with Variable name "rubberband" and path to the rubberband.exe
  4. Make sure all your relevant users can access the path and the rubberband variable (for me, I had to set it up for the admin account and my local user account). This can be checked by opening cmd and typing "rubberband". If the command works, the library is recognized.
  5. Restart the Program in which you want to access the library (e.g. restart Visual Studio)
Sushant Agarwal
  • 440
  • 4
  • 10
1

The answer to the problem was to install pyrubberband with brew, rather than pip.