Se o seu problema for de uso, envie-o aqui: - StackOverflow com a tag scikit-learn: http://stackoverflow.com/questions/tagged/scikit-learn - Lista de correspondência: https://lists.sourceforge.net / lists / listinfo / scikit-learn-general Para obter mais informações, consulte as perguntas do usuário: http://scikit-learn.org/stable/support.html#user-questions Instruções para registrar um bug: https://github.com /scikit-learn/scikit-learn/blob/master/CONTRIBUTING.md#filing-bugs
Versão dev instalada pela primeira vez. Recebo um erro de importação quando tento carregar qualquer ferramenta.
de sklearn.ensemble import RandomForestRegressor
Sem erro.
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
Darwin-15.4.0-x86_64-i386-64bit
('Python', '2.7.11 | Anaconda customizado (x86_64) | (padrão, 6 de dezembro de 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')
Procurando por edições anteriores, # 3606 parece relevante. Mesmo eu não estou ciente dos internos, mas por favor nos avise se ajudar.
Olá, depois de tentar várias coisas, pareceu funcionar (o crédito vai para Dennis Engermann, que postou isso em https://groups.google.com/a/continuum.io/forum/#!topic/anaconda/F8Q-8xyvrks )
Vinculando simbolicamente todas as bibliotecas do anaconda ...
for lib in ~/anaconda/lib/*; do ln -s $lib /usr/local/lib/$(basename $lib); done
Eu encerro o problema, obrigado por compartilhar esta solução
Comentários muito úteis
Olá, depois de tentar várias coisas, pareceu funcionar (o crédito vai para Dennis Engermann, que postou isso em https://groups.google.com/a/continuum.io/forum/#!topic/anaconda/F8Q-8xyvrks )
Vinculando simbolicamente todas as bibliotecas do anaconda ...