【问题标题】:librosa installation via pip failing通过 pip 安装 librosa 失败
【发布时间】:2018-10-22 16:29:14
【问题描述】:

Python 版本是 3.4.2

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

收集 librosa 收集 joblib>=0.12(来自 librosa)使用 缓存的 https://files.pythonhosted.org/packages/69/91/d217cec1fe6eac525ca964cd67e4f79b1d4ce68b64cb82d0b9ae1af2311e/joblib-0.12.5-py2.py3-none-any.whl 正在收集 numba>=0.38.0(来自 librosa) scikit-learn!=0.19.0,>=0.14.0(来自 librosa)使用缓存 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 收集 scipy>=0.14.0(来自 librosa)使用缓存 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 正在收集 resampy>=0.2.0(来自 librosa) 已要求 满意:./env/lib/python3.4/site-packages 中的六个>=1.3(来自 librosa)(1.11.0)收集装饰器> = 3.0.0(来自librosa)使用 缓存的 https://files.pythonhosted.org/packages/bc/bb/a24838832ba35baf52f32ab1a49b906b5f82fb7c76b2f6a7e35e140bac30/decorator-4.3.0-py2.py3-none-any.whl 已满足要求:numpy>=1.8.0 in ./env/lib/python3.4/site-packages(来自 librosa)(1.15.2)要求 已经满意:audioread>=2.0.0 in ./env/lib/python3.4/site-packages(来自 librosa)(2.1.6)收集 llvmlite>=0.25.0dev0(来自 numba>=0.38.0->librosa)使用缓存 https://files.pythonhosted.org/packages/5e/6c/4711620ae28b8aaa8d731e519ead648359d71c1de0c709e408671236b23a/llvmlite-0.25.0.tar.gz 为收集的包构建轮子:llvmlite Running setup.py bdist_wheel for llvmlite ...错误命令的完整输出 /Users/ishandutta2007/Documents/Projects/my_proj/env/bin/python3.4 -u -c "导入安装工具,标记化;文件='/private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-install-7yb_7yfx/llvmlite/setup.py';f=getattr(标记化, 'open', open)(文件);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:运行 bdist_wheel /Users/ishandutta2007/Documents/Projects/my_proj/env/bin/python3.4 /private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-install-7yb_7yfx/llvmlite/ffi/bu​​ild.py LLVM 版本... Traceback(最近一次调用最后一次): 文件“/private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-install-7yb_7yfx/llvmlite/ffi/bu​​ild.py”, 第 105 行,在 main_posix out = subprocess.check_output([llvm_config, '--version']) 文件“/Users/ishandutta2007/.pyenv/versions/3.4.2/lib/python3.4/subprocess.py”, 第 607 行,在 check_output 中 使用 Popen(*popenargs, stdout=PIPE, **kwargs) 作为进程: 文件“/Users/ishandutta2007/.pyenv/versions/3.4.2/lib/python3.4/subprocess.py”, 第 858 行,在 init 中 恢复信号,开始新会话) 文件“/Users/ishandutta2007/.pyenv/versions/3.4.2/lib/python3.4/subprocess.py”, 第 1456 行,在 _execute_child 中 raise child_exception_type(errno_num, err_msg) FileNotFoundError: [Errno 2] 没有这样的文件或目录:'llvm-config' 在处理上述异常的过程中,又出现了一个异常: 回溯(最近一次通话最后): 文件“/private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-install-7yb_7yfx/llvmlite/ffi/bu​​ild.py”, 第 167 行,在 主要的() 文件“/private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-install-7yb_7yfx/llvmlite/ffi/bu​​ild.py”, 第 161 行,主要 main_posix('osx', '.dylib') 文件“/private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-install-7yb_7yfx/llvmlite/ffi/bu​​ild.py”, 第 108 行,在 main_posix "to the path for llvm-config" % (llvm_config,)) RuntimeError: llvm-config failed execution, please point LLVM_CONFIG to the path for llvm 配置错误:命令 '/Users/ishandutta2007/Documents/Projects/my_proj/env/bin/python3.4' 退出状态为 1 失败 ---------------------------------------------------- llvmlite 运行 setup.py clean 的构建轮失败对于 llvmlite 无法构建 llvmlite 安装收集的包:joblib、llvmlite、numba、 scipy、scikit-learn、resampy、decorator、librosa 运行 setup.py 为llvmlite安装...错误 命令 /Users/ishandutta2007/Documents/Projects/my_proj/env/bin/python3.4 的完整输出 -u -c "导入安装工具,标记化;文件='/private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-install-7yb_7yfx/llvmlite/setup.py';f=getattr(标记化, 'open', open)(文件);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" 安装 --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: 运行安装 运行构建 从文件 /private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-install-7yb_7yfx/llvmlite/llvmlite/_version.py 获取版本 {'完整':'9af98a608a49278dbc4ce5dc743152f2341b6a87','版本': '0.25.0'} 运行 build_ext /Users/ishandutta2007/Documents/Projects/my_proj/env/bin/python3.4 /private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-install-7yb_7yfx/llvmlite/ffi/bu​​ild.py LLVM 版本... Traceback(最近一次调用最后一次): 文件“/private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-install-7yb_7yfx/llvmlite/ffi/bu​​ild.py”, 第 105 行,在 main_posix out = subprocess.check_output([llvm_config, '--version']) 文件“/Users/ishandutta2007/.pyenv/versions/3.4.2/lib/python3.4/subprocess.py”, 第 607 行,在 check_output 中 使用 Popen(*popenargs, stdout=PIPE, **kwargs) 作为进程: 文件“/Users/ishandutta2007/.pyenv/versions/3.4.2/lib/python3.4/subprocess.py”, 第 858 行,在 init 中 恢复信号,开始新会话) 文件“/Users/ishandutta2007/.pyenv/versions/3.4.2/lib/python3.4/subprocess.py”, 第 1456 行,在 _execute_child 中 raise child_exception_type(errno_num, err_msg) FileNotFoundError:[Errno 2] 没有这样的文件或目录:'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",

第 167 行,在 主要的() 文件“/private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-install-7yb_7yfx/llvmlite/ffi/bu​​ild.py”, 第 161 行,主要 main_posix('osx', '.dylib') 文件“/private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-install-7yb_7yfx/llvmlite/ffi/bu​​ild.py”, 第 108 行,在 main_posix “到 llvm-config 的路径”% (llvm_config,)) RuntimeError: llvm-config 执行失败,请将 LLVM_CONFIG 指向 llvm-config 的路径 错误:命令'/Users/ishandutta2007/Documents/Projects/my_proj/env/bin/python3.4' 退出状态为 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(标记化, 'open', open)(文件);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" 安装 --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" 失败,错误代码为 1 /private/var/folders/wb/85mzqshn0gv54rd1jnpgn6tm0000gn/T/pip-install-7yb_7yfx/llvmlite/

我也安装了llvm,但结果还是一样

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

==> 重新安装 llvm ==> 正在下载https://homebrew.bintray.com/bottles/llvm-7.0.0.high_sierra.bottle.1.tar.gz

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

==> 浇注llvm-7.0.0.high_sierra.bottle.1.tar.gz

==> 注意事项 要使用捆绑的 libc++,请添加以下 LDFLAGS: LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"

llvm 仅用于小桶,这意味着它没有符号链接到 /usr/local, 因为 macOS 已经提供了这个软件并安装了另一个 并行版本可能会导致各种麻烦。

如果您需要在您的 PATH 运行中首先使用 llvm:echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.bash_profile

要让编译器找到 llvm,您可能需要设置:export LDFLAGS="-L/usr/local/opt/llvm/lib" 导出 CPPFLAGS="-I/usr/local/opt/llvm/include"

==> 总结 ???? /usr/local/Cellar/llvm/7.0.0:2,727 个文件,1.4GB

【问题讨论】:

    标签: python-3.x llvm librosa


    【解决方案1】:

    仔细阅读错误日志后,意识到我们需要的是 llvm 版本 6,而不是我默认的 llvm 版本 7,

    第 1 步: brew install llvm@6

    第 2 步: 将以下内容添加到 ~/.bashrc

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

    第三步:重新加载~/.bashrc

    source ~/.bashrc
    

    【讨论】:

    • 感谢您在解决问题后回答您的问题。这真的很重要。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-11-26
    • 1970-01-01
    • 1970-01-01
    • 2014-09-07
    • 2018-10-23
    • 2021-01-28
    • 2016-09-25
    相关资源
    最近更新 更多