gpt4 book ai didi

python-3.x - 通过 pip 安装 librosa 失败

转载 作者:行者123 更新时间:2023-12-04 17:44:47 29 4
gpt4 key购买 nike

Python版本为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/

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

(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

最佳答案

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

第 1 步: brew install llvm@6

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

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

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

source ~/.bashrc

关于python-3.x - 通过 pip 安装 librosa 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52643713/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com