librosa installation via pip failing

做~自己de王妃 提交于 2021-02-10 14:52:04

问题


Python version is 3.4.2

(env) ishandutta2007@MacBook-Pro:~/Documents/Projects/my_proj$ pip install librosa

Collecting librosa Collecting joblib>=0.12 (from librosa) Using cached https://files.pythonhosted.org/packages/69/91/d217cec1fe6eac525ca964cd67e4f79b1d4ce68b64cb82d0b9ae1af2311e/joblib-0.12.5-py2.py3-none-any.whl Collecting numba>=0.38.0 (from librosa) Collecting scikit-learn!=0.19.0,>=0.14.0 (from librosa) Using cached https://files.pythonhosted.org/packages/9b/bc/3f579cb9c58e3fdc7d4d66e9b47822ee5e6679dcf72d206831c77d8b6554/scikit_learn-0.20.0-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl Collecting scipy>=0.14.0 (from librosa) Using cached https://files.pythonhosted.org/packages/3a/ad/64a741013cbdf1c364779e54d7413554c4f6c8fd8d790a8c805f593d10ea/scipy-1.1.0-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl Collecting resampy>=0.2.0 (from librosa) Requirement already satisfied: six>=1.3 in ./env/lib/python3.4/site-packages (from librosa) (1.11.0) Collecting decorator>=3.0.0 (from librosa) Using cached https://files.pythonhosted.org/packages/bc/bb/a24838832ba35baf52f32ab1a49b906b5f82fb7c76b2f6a7e35e140bac30/decorator-4.3.0-py2.py3-none-any.whl Requirement already satisfied: numpy>=1.8.0 in ./env/lib/python3.4/site-packages (from librosa) (1.15.2) Requirement already satisfied: audioread>=2.0.0 in ./env/lib/python3.4/site-packages (from librosa) (2.1.6) Collecting llvmlite>=0.25.0dev0 (from numba>=0.38.0->librosa) Using cached https://files.pythonhosted.org/packages/5e/6c/4711620ae28b8aaa8d731e519ead648359d71c1de0c709e408671236b23a/llvmlite-0.25.0.tar.gz Building wheels for collected packages: llvmlite Running setup.py bdist_wheel for llvmlite ... error Complete output from command /Users/ishandutta2007/Documents/Projects/my_proj/env/bin/python3.4 -u -c "import setuptools, tokenize;file='/private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-install-7yb_7yfx/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 /private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-wheel-me97wgqk --python-tag cp34: running bdist_wheel /Users/ishandutta2007/Documents/Projects/my_proj/env/bin/python3.4 /private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-install-7yb_7yfx/llvmlite/ffi/build.py LLVM version... Traceback (most recent call last): File "/private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-install-7yb_7yfx/llvmlite/ffi/build.py", line 105, in main_posix out = subprocess.check_output([llvm_config, '--version']) File "/Users/ishandutta2007/.pyenv/versions/3.4.2/lib/python3.4/subprocess.py", line 607, in check_output with Popen(*popenargs, stdout=PIPE, **kwargs) as process: File "/Users/ishandutta2007/.pyenv/versions/3.4.2/lib/python3.4/subprocess.py", line 858, in init restore_signals, start_new_session) File "/Users/ishandutta2007/.pyenv/versions/3.4.2/lib/python3.4/subprocess.py", line 1456, in _execute_child raise child_exception_type(errno_num, err_msg) FileNotFoundError: [Errno 2] No such file or directory: 'llvm-config' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-install-7yb_7yfx/llvmlite/ffi/build.py", line 167, in main() File "/private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-install-7yb_7yfx/llvmlite/ffi/build.py", line 161, in main main_posix('osx', '.dylib') File "/private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-install-7yb_7yfx/llvmlite/ffi/build.py", line 108, in main_posix "to the path for llvm-config" % (llvm_config,)) RuntimeError: llvm-config failed executing, please point LLVM_CONFIG to the path for llvm-config error: command '/Users/ishandutta2007/Documents/Projects/my_proj/env/bin/python3.4' failed with exit status 1 ---------------------------------------- Failed building wheel for llvmlite Running setup.py clean for llvmlite Failed to build llvmlite Installing collected packages: joblib, llvmlite, numba, scipy, scikit-learn, resampy, decorator, librosa Running setup.py install for llvmlite ... error Complete output from command /Users/ishandutta2007/Documents/Projects/my_proj/env/bin/python3.4 -u -c "import setuptools, tokenize;file='/private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-install-7yb_7yfx/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 /private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-record-g2lb1vmw/install-record.txt --single-version-externally-managed --compile --install-headers /Users/ishandutta2007/Documents/Projects/my_proj/env/include/site/python3.4/llvmlite: running install running build got version from file /private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-install-7yb_7yfx/llvmlite/llvmlite/_version.py {'full': '9af98a608a49278dbc4ce5dc743152f2341b6a87', 'version': '0.25.0'} running build_ext /Users/ishandutta2007/Documents/Projects/my_proj/env/bin/python3.4 /private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-install-7yb_7yfx/llvmlite/ffi/build.py LLVM version... Traceback (most recent call last): File "/private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-install-7yb_7yfx/llvmlite/ffi/build.py", line 105, in main_posix out = subprocess.check_output([llvm_config, '--version']) File "/Users/ishandutta2007/.pyenv/versions/3.4.2/lib/python3.4/subprocess.py", line 607, in check_output with Popen(*popenargs, stdout=PIPE, **kwargs) as process: File "/Users/ishandutta2007/.pyenv/versions/3.4.2/lib/python3.4/subprocess.py", line 858, in init restore_signals, start_new_session) File "/Users/ishandutta2007/.pyenv/versions/3.4.2/lib/python3.4/subprocess.py", line 1456, in _execute_child raise child_exception_type(errno_num, err_msg) FileNotFoundError: [Errno 2] No such file or directory: 'llvm-config'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-install-7yb_7yfx/llvmlite/ffi/build.py",

line 167, in main() File "/private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-install-7yb_7yfx/llvmlite/ffi/build.py", line 161, in main main_posix('osx', '.dylib') File "/private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-install-7yb_7yfx/llvmlite/ffi/build.py", line 108, in main_posix "to the path for llvm-config" % (llvm_config,)) RuntimeError: llvm-config failed executing, please point LLVM_CONFIG to the path for llvm-config error: command '/Users/ishandutta2007/Documents/Projects/my_proj/env/bin/python3.4' failed with exit status 1

---------------------------------------- Command "/Users/ishandutta2007/Documents/Projects/my_proj/env/bin/python3.4

-u -c "import setuptools, tokenize;file='/private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-install-7yb_7yfx/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 /private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-record-g2lb1vmw/install-record.txt --single-version-externally-managed --compile --install-headers /Users/ishandutta2007/Documents/Projects/my_proj/env/include/site/python3.4/llvmlite" failed with error code 1 in /private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-install-7yb_7yfx/llvmlite/

I installed llvm too but still result is the same

(env) ishandutta2007@MacBook-Pro:~/Documents/Projects/my_proj$ brew reinstall llvm

==> Reinstalling llvm ==> Downloading https://homebrew.bintray.com/bottles/llvm-7.0.0.high_sierra.bottle.1.tar.gz

################################################################## 100.0%

==> Pouring llvm-7.0.0.high_sierra.bottle.1.tar.gz

==> Caveats To use the bundled libc++ please add the following LDFLAGS: LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"

llvm is keg-only, which means it was not symlinked into /usr/local, because macOS already provides this software and installing another version in parallel can cause all kinds of trouble.

If you need to have llvm first in your PATH run: echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.bash_profile

For compilers to find llvm you may need to set: export LDFLAGS="-L/usr/local/opt/llvm/lib" export CPPFLAGS="-I/usr/local/opt/llvm/include"

==> Summary 🍺 /usr/local/Cellar/llvm/7.0.0: 2,727 files, 1.4GB


回答1:


After reading the error log carefully, realised we need llvm version 6 instead of llvm version 7 which I had by default,

Step 1: brew install llvm@6

Step 2: Added the following to ~/.bashrc

export LLVM_CONFIG=/usr/local/opt/llvm@6/bin/llvm-config

Step 3: Reload ~/.bashrc

source ~/.bashrc



回答2:


If pip install is failing, you can try either of the following in Anaconda prompt:

easy_install librosa

OR

sudo pip install librosa

For me, easy_install worked fine!



来源:https://stackoverflow.com/questions/52643713/librosa-installation-via-pip-failing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!