Scikit-learn: ImportError: image not found after install of dev version

Created on 20 Apr 2016  路  3Comments  路  Source: scikit-learn/scikit-learn

Description

Installed dev version for first time. I get an import error when I try to load any tool.

Steps/Code to Reproduce

from sklearn.ensemble import RandomForestRegressor

Expected Results

No error.

Actual Results

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

Versions

Darwin-15.4.0-x86_64-i386-64bit
('Python', '2.7.11 |Anaconda custom (x86_64)| (default, Dec 6 2015, 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')

Most helpful comment

Hi, after trying a lot of things, this seemed to work (credit goes to Dennis Engermann who posted this on https://groups.google.com/a/continuum.io/forum/#!topic/anaconda/F8Q-8xyvrks)

Symbolically linking all anaconda libraries...

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

All 3 comments

Searching for previous issues, #3606 seems relevant. Even I am not aware of the internals, but please let us know if it helps.

Hi, after trying a lot of things, this seemed to work (credit goes to Dennis Engermann who posted this on https://groups.google.com/a/continuum.io/forum/#!topic/anaconda/F8Q-8xyvrks)

Symbolically linking all anaconda libraries...

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

I close the issue, thanks for sharing this solution

Was this page helpful?
0 / 5 - 0 ratings