Scikit-learn: 导入错误:安装开发版本后找不到图像

创建于 2016-04-20  ·  3评论  ·  资料来源: scikit-learn/scikit-learn

如果您的问题是使用问题,请在此处提交: - 带有 scikit-learn 标签的 StackOverflow:http://stackoverflow.com/questions/tagged/scikit-learn - 邮件列表:https://lists.sourceforge.net /lists/listinfo/scikit-learn-general 有关更多信息,请参阅用户问题:http://scikit-learn.org/stable/support.html#user-questions 提交错误的说明:https://github.com /scikit-learn/scikit-learn/blob/master/CONTRIBUTING.md#filing-bugs

描述

第一次安装开发版。 当我尝试加载任何工具时出现导入错误。

重现的步骤/代码

示例:md5-c7388c0cd54243d77b145783344f4c4c 如果代码太长,请随意将其放入公共 gist 并在 issue 中链接:https://gist.github.com

从 sklearn.ensemble 导入 RandomForestRegressor

预期成绩

示例:没有错误抛出。 请粘贴或描述预期的结果。

没有错误。

实际结果

请粘贴或具体描述实际输出或回溯。
ImportError                               Traceback (most recent call last)
<ipython-input-1-4b1325c8d865> in <module>()
----> 1 from sklearn.ensemble import RandomForestRegressor

/Users/timothychan/.local/lib/python2.7/site-packages/sklearn/ensemble/__init__.py in <module>()
      5 
      6 from .base import BaseEnsemble
----> 7 from .forest import RandomForestClassifier
      8 from .forest import RandomForestRegressor
      9 from .forest import RandomTreesEmbedding

/Users/timothychan/.local/lib/python2.7/site-packages/sklearn/ensemble/forest.py in <module>()
     54 from ..externals.joblib import Parallel, delayed
     55 from ..externals import six
---> 56 from ..feature_selection.from_model import _LearntSelectorMixin
     57 from ..metrics import r2_score
     58 from ..preprocessing import OneHotEncoder

/Users/timothychan/.local/lib/python2.7/site-packages/sklearn/feature_selection/__init__.py in <module>()
     18 from .variance_threshold import VarianceThreshold
     19 
---> 20 from .rfe import RFE
     21 from .rfe import RFECV
     22 

/Users/timothychan/.local/lib/python2.7/site-packages/sklearn/feature_selection/rfe.py in <module>()
     15 from ..base import is_classifier
     16 from ..externals.joblib import Parallel, delayed
---> 17 from ..model_selection import check_cv
     18 from ..model_selection._validation import _safe_split, _score
     19 from ..metrics.scorer import check_scoring

/Users/timothychan/.local/lib/python2.7/site-packages/sklearn/model_selection/__init__.py in <module>()
----> 1 from ._split import BaseCrossValidator
      2 from ._split import KFold
      3 from ._split import LabelKFold
      4 from ._split import StratifiedKFold
      5 from ._split import LeaveOneLabelOut

/Users/timothychan/.local/lib/python2.7/site-packages/sklearn/model_selection/_split.py in <module>()
     33 from ..utils.fixes import signature
     34 from ..base import _pprint
---> 35 from ..gaussian_process.kernels import Kernel as GPKernel
     36 
     37 __all__ = ['BaseCrossValidator',

/Users/timothychan/.local/lib/python2.7/site-packages/sklearn/gaussian_process/__init__.py in <module>()
     11 """
     12 
---> 13 from .gpr import GaussianProcessRegressor
     14 from .gpc import GaussianProcessClassifier
     15 from . import kernels

/Users/timothychan/.local/lib/python2.7/site-packages/sklearn/gaussian_process/gpr.py in <module>()
     13 
     14 from sklearn.base import BaseEstimator, RegressorMixin, clone
---> 15 from sklearn.gaussian_process.kernels import RBF, ConstantKernel as C
     16 from sklearn.utils import check_random_state
     17 from sklearn.utils.validation import check_X_y, check_array

/Users/timothychan/.local/lib/python2.7/site-packages/sklearn/gaussian_process/kernels.py in <module>()
     28 from scipy.spatial.distance import pdist, cdist, squareform
     29 
---> 30 from ..metrics.pairwise import pairwise_kernels
     31 from ..externals import six
     32 from ..base import clone

/Users/timothychan/.local/lib/python2.7/site-packages/sklearn/metrics/__init__.py in <module>()
     31 from .classification import brier_score_loss
     32 
---> 33 from . import cluster
     34 from .cluster import adjusted_mutual_info_score
     35 from .cluster import adjusted_rand_score

/Users/timothychan/.local/lib/python2.7/site-packages/sklearn/metrics/cluster/__init__.py in <module>()
     17 from .supervised import v_measure_score
     18 from .supervised import entropy
---> 19 from .unsupervised import silhouette_samples
     20 from .unsupervised import silhouette_score
     21 from .bicluster import consensus_score

/Users/timothychan/.local/lib/python2.7/site-packages/sklearn/metrics/cluster/unsupervised.py in <module>()
      9 from ...utils import check_random_state
     10 from ...utils import check_X_y
---> 11 from ..pairwise import pairwise_distances
     12 from ...preprocessing import LabelEncoder
     13 

/Users/timothychan/.local/lib/python2.7/site-packages/sklearn/metrics/pairwise.py in <module>()
     27 from ..externals.joblib.parallel import cpu_count
     28 
---> 29 from .pairwise_fast import _chi2_kernel_fast, _sparse_manhattan
     30 
     31 

ImportError: dlopen(/Users/timothychan/.local/lib/python2.7/site-packages/sklearn/metrics/pairwise_fast.so, 2): Library not loaded: libmkl_intel_lp64.dylib
  Referenced from: /Users/timothychan/.local/lib/python2.7/site-packages/sklearn/metrics/pairwise_fast.so
  Reason: image not found

版本

请运行以下代码段并粘贴下面的输出。 进口平台; 打印(平台。平台())导入系统; 打印(“Python”,sys.version)导入numpy; 打印(“NumPy”,numpy.__version__)导入scipy; 打印(“SciPy”,scipy.__version__)导入sklearn; 打印(“Scikit-Learn”,sklearn.__version__)

Darwin-15.4.0-x86_64-i386-64bit
('Python', '2.7.11 |Anaconda custom (x86_64)|(默认,2015 年 12 月 6 日,18:57:58)\n[GCC 4.2.1(Apple Inc. build 5577)]')
('NumPy', '1.11.0')
('SciPy', '0.17.0')
('Scikit-Learn', '0.18.dev0')

感谢您的贡献!

最有用的评论

嗨,在尝试了很多事情之后,这似乎奏效了(归功于丹尼斯·恩格曼(Dennis Engermann),他在 https://groups.google.com/a/continuum.io/forum/#!topic/anaconda/F8Q-8xyvrks 上发布了此内容)

象征性地链接所有 anaconda 库...

for lib in ~/anaconda/lib/*; do ln -s $lib /usr/local/lib/$(basename $lib); done

所有3条评论

搜索以前的问题,#3606 似乎相关。 即使我不知道内部结构,但如果有帮助,请告诉我们。

嗨,在尝试了很多事情之后,这似乎奏效了(归功于丹尼斯·恩格曼(Dennis Engermann),他在 https://groups.google.com/a/continuum.io/forum/#!topic/anaconda/F8Q-8xyvrks 上发布了此内容)

象征性地链接所有 anaconda 库...

for lib in ~/anaconda/lib/*; do ln -s $lib /usr/local/lib/$(basename $lib); done

我关闭了问题,感谢分享此解决方案

此页面是否有帮助?
0 / 5 - 0 等级