import librosa gives LLVM ERROR

3,058 views
Skip to first unread message

Goutham Kamath

unread,
Nov 4, 2017, 11:00:25 PM11/4/17
to librosa
I am trying to install librosa inside a docker on armv7 Raspberry pi. Here are the steps I followed:
apt-get update
apt-get install cython build-essential libedit-dev
apt-get install llvm-4.0 llvm-4.0-dev llvm-dev

LLVM_CONFIG=/usr/lib/llvm-4.0/bin/llvm-config pip install llvmlite==0.19.0
LLVM_CONFIG=/usr/lib/llvm-4.0/bin/llvm-config pip install numba==0.32
pip install librosa==0.5.1

I am able to successfully install without errors and also can import llvmlite and numba. However, when I import librosa I get the following error
>> import librosa
LLVM ERROR: Program used external function '__aeabi_unwind_cpp_pr0' which could not be resolved!

I am running Python 2.7.12 with GCC 5.4.0 inside docker with ubuntu-14.04 base. 

Brian McFee

unread,
Nov 13, 2017, 5:52:19 PM11/13/17
to librosa
Yikes!  It looks like an abi incompatibility issue that you might want to raise with the numba or llvmlite folks.  We're not doing anything fancy with numba, so it's almost certainly deeper in the stack than librosa.

A couple of things to try:

  • Upgrade numba and llvmlite to more recent versions (if availably on rasp)
  • If nothing works, you can back off resampy to the older 0.1.x series.  It's functionally and API-equivalent, but built on cython instead of numba.  It's not a long-term fix, but it should unblock you until the numba issue gets resolved upstream.

Sree R

unread,
Nov 28, 2017, 3:25:30 AM11/28/17
to librosa
Hi
I am getting the same error however I am unable to install an older version of librosa.

pi@raspberrypi:~ $ sudo pip3 install librosa==0.1.1

Collecting librosa==0.1.1

  Could not find a version that satisfies the requirement librosa==0.1.1 (from versions: 0.2.0.linux-x86_64, 0.2.1.linux-x86_64, 0.2.0, 0.2.1, 0.3.0, 0.3.1, 0.4.0rc2, 0.4.0, 0.4.1rc0, 0.4.1, 0.4.2, 0.4.3rc0, 0.4.3, 0.5.0rc0, 0.5.0, 0.5.1)

No matching distribution found for librosa==0.1.1

pi@raspberrypi:~ $ sudo pip3 install librosa==0.1.0

Collecting librosa==0.1.0

  Could not find a version that satisfies the requirement librosa==0.1.0 (from versions: 0.2.0.linux-x86_64, 0.2.1.linux-x86_64, 0.2.0, 0.2.1, 0.3.0, 0.3.1, 0.4.0rc2, 0.4.0, 0.4.1rc0, 0.4.1, 0.4.2, 0.4.3rc0, 0.4.3, 0.5.0rc0, 0.5.0, 0.5.1)

No matching distribution found for librosa==0.1.0

pi@raspberrypi:~ $ sudo pip3 install librosa==0.1.9

Collecting librosa==0.1.9

  Could not find a version that satisfies the requirement librosa==0.1.9 (from versions: 0.2.0.linux-x86_64, 0.2.1.linux-x86_64, 0.2.0, 0.2.1, 0.3.0, 0.3.1, 0.4.0rc2, 0.4.0, 0.4.1rc0, 0.4.1, 0.4.2, 0.4.3rc0, 0.4.3, 0.5.0rc0, 0.5.0, 0.5.1)

No matching distribution found for librosa==0.1.9

pi@raspberrypi:~ $ 

Brian McFee

unread,
Nov 28, 2017, 9:07:08 AM11/28/17
to librosa
I meant to say to install resampy==0.1, not librosa==0.1.

Sree R

unread,
Nov 28, 2017, 10:54:09 AM11/28/17
to librosa
Ok so I should install resampy==0.1, uninstall numba, and install librosa. Will librosa automatically use resampy or do we need to install a specific version of librosa. 

Sree R

unread,
Nov 28, 2017, 7:19:00 PM11/28/17
to librosa
After installing Resampy=0.1 and then importing Librosa I get the following error

Python 3.5.3 (default, Jan 19 2017, 14:11:04) 

[GCC 6.3.0 20170124] on linux

Type "help", "copyright", "credits" or "license" for more information.

>>> import librosa

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

  File "/usr/local/lib/python3.5/dist-packages/librosa/__init__.py", line 12, in <module>

    from . import core

  File "/usr/local/lib/python3.5/dist-packages/librosa/core/__init__.py", line 109, in <module>

    from .audio import *  # pylint: disable=wildcard-import

  File "/usr/local/lib/python3.5/dist-packages/librosa/core/audio.py", line 23, in <module>

    BW_BEST = resampy.filters.get_filter('kaiser_best')[2]

IndexError: tuple index out of range

Brian McFee

unread,
Nov 29, 2017, 8:35:14 AM11/29/17
to librosa
Which exact resampy version did you install?  You might have to explicitly ask for 0.1.5.  Librosa needs at least 0.1.2, and if it got an older version, it may cause api incompatibility issues.

adrian...@gmail.com

unread,
Feb 5, 2018, 1:23:47 PM2/5/18
to librosa
I have been trying to get librosa working on my Pi 3 for days.  I have the same issues as the OP. I am using this version of linux: Linux raspberrypi 4.9.13-v7+ #974 SMP Wed Mar 1 20:09:48 GMT 2017 armv7l GNU/Linux

I have the following packages installed:

pi@raspberrypi:~ $ sudo pip3 install llvmlite==0.15.0
Requirement already satisfied: llvmlite==0.15.0 in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied: enum34 in /usr/local/lib/python2.7/dist-packages (from llvmlite==0.15.0)
pi@raspberrypi:~ $ sudo pip3 install numba==0.32.0
Requirement already satisfied: numba==0.32.0 in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied: numpy in /usr/local/lib/python2.7/dist-packages (from numba==0.32.0)
Requirement already satisfied: llvmlite in /usr/local/lib/python2.7/dist-packages (from numba==0.32.0)
Requirement already satisfied: singledispatch in /usr/local/lib/python2.7/dist-packages/singledispatch-3.4.0.3-py2.7.egg (from numba==0.32.0)
Requirement already satisfied: enum34 in /usr/local/lib/python2.7/dist-packages (from numba==0.32.0)
Requirement already satisfied: funcsigs in /usr/local/lib/python2.7/dist-packages (from numba==0.32.0)
Requirement already satisfied: six in /usr/local/lib/python2.7/dist-packages (from singledispatch->numba==0.32.0)
pi@raspberrypi:~ $ sudo pip3 install librosa
Requirement already satisfied: librosa in /usr/local/lib/python2.7/dist-packages
Requirement already satisfied: scipy>=0.13.0 in /usr/lib/python2.7/dist-packages (from librosa)
Requirement already satisfied: numpy>=1.8.0 in /usr/local/lib/python2.7/dist-packages (from librosa)
Requirement already satisfied: six>=1.3 in /usr/local/lib/python2.7/dist-packages (from librosa)
Requirement already satisfied: decorator>=3.0.0 in /usr/lib/python2.7/dist-packages (from librosa)
Requirement already satisfied: audioread>=2.0.0 in /usr/local/lib/python2.7/dist-packages (from librosa)
Requirement already satisfied: scikit-learn>=0.14.0 in /usr/local/lib/python2.7/dist-packages (from librosa)
Requirement already satisfied: resampy>=0.1.2 in /usr/local/lib/python2.7/dist-packages (from librosa)
Requirement already satisfied: joblib>=0.7.0 in /usr/local/lib/python2.7/dist-packages (from librosa)
Requirement already satisfied: Cython>=0.23 in /usr/lib/python2.7/dist-packages (from resampy>=0.1.2->librosa)

Importing with Python 3 gives me this error:

pi@raspberrypi:~ $ python3
Python 3.5.3 (default, Jan 19 2017, 14:11:04) 
[GCC 6.3.0 20170124] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import librosa
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'librosa'
>>> 

Installing the packages with pip, and trying Python 2 gives me this error:

pi@raspberrypi:~ $ python
Python 2.7.13 (default, Nov 24 2017, 17:33:09) 
[GCC 6.3.0 20170516] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import librosa
LLVM ERROR: Program used external function '__aeabi_unwind_cpp_pr0' which could not be resolved!

Can anyone help me get librosa working?

Many thanks in advance.

Brian McFee

unread,
Feb 6, 2018, 9:07:19 AM2/6/18
to librosa
Sorry you're having troubles here.  I haven't tested thoroughly on rasp, so there's a good chance that some of the dependencies are either outdated, or have binary compatibility issues.  That said, here's what I can guess from your log:

  • if you have llvmlite and numba working, then you can use resampy >= 0.2.  This is true independent of python 2 or 3.
  • If you don't have llvmlite working, then you need to use resampy 0.1.x -- 0.1.5 ought to work. You might have to install from source.
    • If llvmlite is not working, as it appears from the error you posted below, you should take it up with the llvmlite/numba developers.  Librosa is pure python, and only interfaces with llvm through numba.
  • if it can't find librosa in your python 3 environment, then it's not installed properly.  Maybe try uninstalling and reinstalling librosa?
  • I strongly recommend using either a virtual environment (venv) or a conda environment to isolate packages.  That way, once you get it working, you can always reconstruct exactly the right versions.  Also, conda binary distributions for some of the dependencies (llvmlite, numba, etc) might be more reliable for your OS/hardware.  BerryConda might be of interest to you.
I hope some subset of that helps!
Reply all
Reply to author
Forward
0 new messages