Not able to install librosa
Asked Answered
P

1

2

I am not able to install librosa in Ubuntu 18.04. I have tried the following commands, all are failed.

pip install librosa 
python3.8 -m pip install librosa
sudo pip install librosa
pip install -u librosa

The below error I am getting:

Failed cleaning build dir for numba
  Running setup.py bdist_wheel for resampy ... done
  Stored in directory: /home/nageshas/.cache/pip/wheels/fa/c1/56/e0e12c6f7f3d2cdea9712b35136a2d40a7817c6210ec096485
  Running setup.py bdist_wheel for llvmlite ... error
  Complete output from command /usr/bin/python3.8 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-zrky3kzn/llvmlite/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmphpnrxd05pip-wheel- --python-tag cp38:
  running bdist_wheel
  /usr/bin/python3.8 /tmp/pip-build-zrky3kzn/llvmlite/ffi/build.py
  LLVM version... Traceback (most recent call last):
    File "/tmp/pip-build-zrky3kzn/llvmlite/ffi/build.py", line 220, in <module>
      main()
    File "/tmp/pip-build-zrky3kzn/llvmlite/ffi/build.py", line 210, in main
      main_posix('linux', '.so')
    File "/tmp/pip-build-zrky3kzn/llvmlite/ffi/build.py", line 134, in main_posix
      raise RuntimeError(msg) from None
  RuntimeError: Could not find a `llvm-config` binary. There are a number of reasons this could occur, please see: https://llvmlite.readthedocs.io/en/latest/admin-guide/install.html#using-pip for help.
  error: command '/usr/bin/python3.8' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for llvmlite
  Running setup.py clean for llvmlite
Successfully built librosa audioread resampy
Failed to build numba llvmlite
Installing collected packages: audioread, decorator, joblib, llvmlite, numpy, setuptools, numba, chardet, urllib3, idna, certifi, requests, pyparsing, packaging, appdirs, pooch, scipy, six, resampy, threadpoolctl, scikit-learn, pycparser, cffi, soundfile, librosa
  Running setup.py install for llvmlite ... error
    Complete output from command /usr/bin/python3.8 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-zrky3kzn/llvmlite/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-f20fjedr-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
    running install
    running build
    got version from file /tmp/pip-build-zrky3kzn/llvmlite/llvmlite/_version.py {'version': '0.36.0', 'full': 'e6bb8d137d922bec8beeb01a237254778759becd'}
    running build_ext
    /usr/bin/python3.8 /tmp/pip-build-zrky3kzn/llvmlite/ffi/build.py
    LLVM version... Traceback (most recent call last):
      File "/tmp/pip-build-zrky3kzn/llvmlite/ffi/build.py", line 220, in <module>
        main()
      File "/tmp/pip-build-zrky3kzn/llvmlite/ffi/build.py", line 210, in main
        main_posix('linux', '.so')
      File "/tmp/pip-build-zrky3kzn/llvmlite/ffi/build.py", line 134, in main_posix
        raise RuntimeError(msg) from None
    RuntimeError: Could not find a `llvm-config` binary. There are a number of reasons this could occur, please see: https://llvmlite.readthedocs.io/en/latest/admin-guide/install.html#using-pip for help.
    error: command '/usr/bin/python3.8' failed with exit status 1
    
Prince answered 30/4, 2021 at 9:18 Comment(1)
The below commands I have tried 1) pip install librosa 2) python3.8 -m pip install librosa 3) sudo pip install librosa 4) pip install -u librosa Please help me on this, I am struggling from many daysPrince
P
2

I came across the same issues too.

There are several steps that helped me, but I cannot define the exact one. So I will list all:

  1. First, update setuptools and wheel python3 -m pip install --upgrade pip setuptools wheel

  2. Second python setup.py bdist_wheel

  3. Try to install the previous version of librosa pip install librosa==0.7.2

I hope the first two steps will help

Prelusive answered 14/5, 2021 at 7:33 Comment(1)
Thanks! Worked after the first step!Lecithinase

© 2022 - 2024 — McMap. All rights reserved.