gpt4 book ai didi

python - 库未加载 : libmkl_intel_lp64. dylib,在 OS X 上使用 Anaconda

转载 作者:行者123 更新时间:2023-11-28 21:48:26 25 4
gpt4 key购买 nike

我无法在 OS X (10.11.3) 上使用支持 MKL 的 NumPy 版本。模块似乎安装正常,但当我尝试导入它时出现错误 Library not loaded: @loader_path/../../../../libmkl_intel_lp64.dylib。实际上,如果我搜索此文件 (mdfind -name libmkl_intel_lp64.dylib),则不会返回任何内容。这是包问题还是我安装的问题?同样的过程在我的 Windows 机器上运行完美。我能够毫无困难地安装和导入 nomkl 版本,但如果 MKL 可用,我想使用它。

编辑:从 mkl 包 ( http://anaconda.org/anaconda/mkl/files ) 手动安装 dylib 似乎可行 - 也许这是一个错误?

安装 NumPy:

snorfmac-2:~ snorf$ source activate snowflake
discarding /Users/snorf/miniconda3/bin from PATH
prepending /Users/snorf/miniconda3/envs/snowflake/bin to PATH
(snowflake)snorfmac-2:~ snorf$ conda install numpy
Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata: ......
Solving package specifications: .............
Package plan for installation in environment /Users/snorf/miniconda3/envs/snowflake:

The following NEW packages will be INSTALLED:

mkl: 11.3.1-0
numpy: 1.10.4-py34_0

Proceed ([y]/n)?

Linking packages ...
[ COMPLETE ]|###################################################| 100%

正在尝试导入模块:

(snowflake)snorfmac-2:~ snorf$ python
Python 3.4.4 |Continuum Analytics, Inc.| (default, Jan 9 2016, 17:30:09)
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/snorf/miniconda3/envs/snowflake/lib/python3.4/site-packages/numpy/__init__.py", line 184, in <module>
from . import add_newdocs
File "/Users/snorf/miniconda3/envs/snowflake/lib/python3.4/site-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/Users/snorf/miniconda3/envs/snowflake/lib/python3.4/site-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/Users/snorf/miniconda3/envs/snowflake/lib/python3.4/site-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/Users/snorf/miniconda3/envs/snowflake/lib/python3.4/site-packages/numpy/core/__init__.py", line 14, in <module>
from . import multiarray
ImportError: dlopen(/Users/snorf/miniconda3/envs/snowflake/lib/python3.4/site-packages/numpy/core/multiarray.so, 10): Library not loaded: @loader_path/../../../../libmkl_intel_lp64.dylib
Referenced from: /Users/snorf/miniconda3/envs/snowflake/lib/python3.4/site-packages/numpy/core/multiarray.so
Reason: image not found

最佳答案

看起来由于某种原因安装了 mkl 包,存档没有完全提取。随后的安装使用了这种不完整的提取。这是在运行 conda install --debug mkl 时报告的:

DEBUG:conda.install:pkgs_dir='/Users/snorf/miniconda3/pkgs', prefix='/Users/snorf/miniconda3/envs/python34', dist='mkl-11.3.1-0', linktype=1
ERROR:conda.install:failed to link (src='/Users/snorf/miniconda3/pkgs/mkl-11.3.1-0/lib/libmkl_avx512.dylib', dst='/Users/snorf/miniconda3/envs/python34/lib/libmkl_avx512.dylib', type=1, error=FileNotFoundError(2, 'No such file or directory'))
ERROR:conda.install:failed to link (src='/Users/snorf/miniconda3/pkgs/mkl-11.3.1-0/lib/libmkl_core.dylib', dst='/Users/snorf/miniconda3/envs/python34/lib/libmkl_core.dylib', type=1, error=FileNotFoundError(2, 'No such file or directory'))
ERROR:conda.install:failed to link (src='/Users/snorf/miniconda3/pkgs/mkl-11.3.1-0/lib/libmkl_intel.dylib', dst='/Users/snorf/miniconda3/envs/python34/lib/libmkl_intel.dylib', type=1, error=FileNotFoundError(2, 'No such file or directory'))
ERROR:conda.install:failed to link (src='/Users/snorf/miniconda3/pkgs/mkl-11.3.1-0/lib/libmkl_intel_ilp64.dylib', dst='/Users/snorf/miniconda3/envs/python34/lib/libmkl_intel_ilp64.dylib', type=1, error=FileNotFoundError(2, 'No such file or directory'))
ERROR:conda.install:failed to link (src='/Users/snorf/miniconda3/pkgs/mkl-11.3.1-0/lib/libmkl_intel_lp64.dylib', dst='/Users/snorf/miniconda3/envs/python34/lib/libmkl_intel_lp64.dylib', type=1, error=FileNotFoundError(2, 'No such file or directory'))
ERROR:conda.install:failed to link (src='/Users/snorf/miniconda3/pkgs/mkl-11.3.1-0/lib/libmkl_intel_thread.dylib', dst='/Users/snorf/miniconda3/envs/python34/lib/libmkl_intel_thread.dylib', type=1, error=FileNotFoundError(2, 'No such file or directory'))
ERROR:conda.install:failed to link (src='/Users/snorf/miniconda3/pkgs/mkl-11.3.1-0/lib/libmkl_mc.dylib', dst='/Users/snorf/miniconda3/envs/python34/lib/libmkl_mc.dylib', type=1, error=FileNotFoundError(2, 'No such file or directory'))
ERROR:conda.install:failed to link (src='/Users/snorf/miniconda3/pkgs/mkl-11.3.1-0/lib/libmkl_mc3.dylib', dst='/Users/snorf/miniconda3/envs/python34/lib/libmkl_mc3.dylib', type=1, error=FileNotFoundError(2, 'No such file or directory'))
ERROR:conda.install:failed to link (src='/Users/snorf/miniconda3/pkgs/mkl-11.3.1-0/lib/libmkl_rt.dylib', dst='/Users/snorf/miniconda3/envs/python34/lib/libmkl_rt.dylib', type=1, error=FileNotFoundError(2, 'No such file or directory'))
ERROR:conda.install:failed to link (src='/Users/snorf/miniconda3/pkgs/mkl-11.3.1-0/lib/libmkl_sequential.dylib', dst='/Users/snorf/miniconda3/envs/python34/lib/libmkl_sequential.dylib', type=1, error=FileNotFoundError(2, 'No such file or directory'))
ERROR:conda.install:failed to link (src='/Users/snorf/miniconda3/pkgs/mkl-11.3.1-0/lib/libmkl_vml_avx.dylib', dst='/Users/snorf/miniconda3/envs/python34/lib/libmkl_vml_avx.dylib', type=1, error=FileNotFoundError(2, 'No such file or directory'))
ERROR:conda.install:failed to link (src='/Users/snorf/miniconda3/pkgs/mkl-11.3.1-0/lib/libmkl_vml_avx2.dylib', dst='/Users/snorf/miniconda3/envs/python34/lib/libmkl_vml_avx2.dylib', type=1, error=FileNotFoundError(2, 'No such file or directory'))
ERROR:conda.install:failed to link (src='/Users/snorf/miniconda3/pkgs/mkl-11.3.1-0/lib/libmkl_vml_avx512.dylib', dst='/Users/snorf/miniconda3/envs/python34/lib/libmkl_vml_avx512.dylib', type=1, error=FileNotFoundError(2, 'No such file or directory'))
ERROR:conda.install:failed to link (src='/Users/snorf/miniconda3/pkgs/mkl-11.3.1-0/lib/libmkl_vml_mc.dylib', dst='/Users/snorf/miniconda3/envs/python34/lib/libmkl_vml_mc.dylib', type=1, error=FileNotFoundError(2, 'No such file or directory'))
ERROR:conda.install:failed to link (src='/Users/snorf/miniconda3/pkgs/mkl-11.3.1-0/lib/libmkl_vml_mc2.dylib', dst='/Users/snorf/miniconda3/envs/python34/lib/libmkl_vml_mc2.dylib', type=1, error=FileNotFoundError(2, 'No such file or directory'))
ERROR:conda.install:failed to link (src='/Users/snorf/miniconda3/pkgs/mkl-11.3.1-0/lib/libmkl_vml_mc3.dylib', dst='/Users/snorf/miniconda3/envs/python34/lib/libmkl_vml_mc3.dylib', type=1, error=FileNotFoundError(2, 'No such file or directory'))

删除有问题的目录并重新安装 mkl 包修复了问题。

关于python - 库未加载 : libmkl_intel_lp64. dylib,在 OS X 上使用 Anaconda,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35392996/

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