使用Anaconda Python 3.6导入Sklearn时出错

时间:2018-10-07 09:39:34

标签: python-3.x scikit-learn anaconda

我尝试使用

import sklearn

但是我在下面收到错误消息:

---------------------------------------------------------------------------  
ImportError                               Traceback (most recent call last)
<ipython-input-1-7e12b462961d> in <module>()
    1 
----> 2 import sklearn

~/Downloads/anaconda/lib/python3.6/site-packages/sklearn/__init__.py in 
<module>()
148                'clone']
149 
--> 150     from .daal4sklearn import dispatcher
151     dispatcher.enable()
152 

~/Downloads/anaconda/lib/python3.6/site-packages/sklearn/daal4sklearn/dispatcher.py in <module>()
  7 from ..linear_model.ridge import Ridge
  8 
----> 9 from .k_means import fit as kmeans_fit
 10 from .pca import _fit_full as pca_fit_full
 11 from .pairwise import daal_pairwise_distances

~/Downloads/anaconda/lib/python3.6/site-packages/sklearn/daal4sklearn/k_means.py in <module>()
  5 from ..cluster.k_means_ import k_means
  6 from ..externals.six import string_types
----> 7 from .utils import getArrayFromNumericTable, make_csr_table, make_HomogenNumericTable
  8 from daal.data_management import CSRNumericTable
  9 from daal.data_management import 
HomogenNumericTable,HomogenNumericTable_Float32,HomogenNumericTable_Intc

~/Downloads/anaconda/lib/python3.6/site-packages/sklearn/daal4sklearn/utils.py in <module>()
  1 import numpy as np
  2 from scipy import sparse as sp
----> 3 from daal.data_management import readOnly, NumericTableIface, BlockDescriptor, BlockDescriptor_Float32, packed_mask
  4 from daal.data_management import HomogenNumericTable, HomogenNumericTable_Float32, HomogenNumericTable_Intc, CSRNumericTable
  5 

~/Downloads/anaconda/lib/python3.6/site-packages/daal/__init__.py in <module>()
 55                 fp.close()
 56             return _mod
---> 57     _daal = swig_import_helper()
 58     del swig_import_helper
 59 else:

~/Downloads/anaconda/lib/python3.6/site-packages/daal/__init__.py in swig_import_helper()
 51         if fp is not None:
 52             try:
---> 53                 _mod = imp.load_module('_daal', fp, pathname, description)
 54             finally:
 55                 fp.close()

~/Downloads/anaconda/lib/python3.6/imp.py in load_module(name, file, filename, details)
241                 return load_dynamic(name, filename, opened_file)
242         else:
--> 243             return load_dynamic(name, filename, file)
244     elif type_ == PKG_DIRECTORY:
245         return load_package(name, filename)

~/Downloads/anaconda/lib/python3.6/imp.py in load_dynamic(name, path, file)
341         spec = importlib.machinery.ModuleSpec(
342             name=name, loader=loader, origin=path)
--> 343         return _load(spec)
344 
345 else:

ImportError: dlopen(/Users/Monday123/Downloads/anaconda/lib/python3.6/site-packages/daal/_daal.cpython-36m-darwin.so, 2): Library not loaded: @rpath/libdaal_core.dylib
 Referenced from: /Users/Monday123/Downloads/anaconda/lib/python3.6/site-packages/daal/_daal.cpython-36m-darwin.so
 Reason: image not found

我可以看到有一些类似的问题,但是我的问题与未加载库有关:@ rpath / libdaal_core.dylib。不确定如何解决此问题。

非常感谢

0 个答案:

没有答案