running librosa & numba on raspberry pi 3

前端 未结 5 1653
离开以前
离开以前 2020-12-19 16:28

I am trying to run librosa on my raspberry pi 3. After hours of searching through the internet I was finally able to install it but it still throws an error when I try to i

5条回答
  •  感情败类
    2020-12-19 16:56

    Thanks @MatthewBerryman, you got me over the hump! On the newest Raspian release (stretch) I was successful with the following after several hours of frustration of trying to get librosa installed on Raspian jessie (which my RPi3 came with). Having said this, the following procedure may also work with jessie.

    First, update your system's package list and upgrade all your installed packages to their latest versions with the command:

    sudo apt-get update
    sudo apt-get dist-upgrade
    

    Install Python science stack:

    sudo pip3 install numpy --upgrade 
    sudo apt-get install python3-pandas
    

    (Also seems to install matplotlib, scipy)

    sudo apt-get install python3-sklearn
    

    Then, install the low-level virtual machine, LLVM (per @MatthewBerryman, I used llvm 3.8 and llvmlite 0.15.0, and not the newest combination where I couldn't find the packages.) After installing llvm-3.8, a symbolic link needs to be defined before installing llvmlite.

    sudo apt-get install llvm-3.8
    sudo ln -s /usr/bin/llvm-config-3.8 /usr/bin/llvm-config
    sudo pip3 install llvmlite==0.15.0
    sudo pip3 install numba==0.32.0
    

    Numba is 0.32.0 because if it's the newest (0.36), it will not import because of an llvm mismatch, and if it's a lower version, the librosa install will upgrade it to the newest version.

    Finally, install librosa:

    sudo pip3 install librosa
    

    However, when trying to import librosa, it still throws and error, namely

    ImportError: libf77blas.so.3: cannot open shared object file: No such file or directory
    

    Googling this error indicated this would fix it:

    sudo apt-get install libatlas-base-dev
    

    And it did; however, I have no idea why.

    To summarize, this procedure installs librosa, and there is no error when trying this:

    ...$ python3
    Python 3.5.3 (default, Jan 19 2017, 14:11:04)
    ...
    >>>import librosa
    >>>
    

提交回复
热议问题