Как исправить эту ошибку, связанную с импортом sklearn? - PullRequest
0 голосов
/ 26 мая 2020

ImportError                               Traceback (most recent call last)
<ipython-input-11-a6c78a077b0d> in <module>
     11 from google.oauth2 import service_account
     12 import datetime
---> 13 from sklearn.preprocessing import MinMaxScaler
     14 from sklearn.cluster import KMeans
     15 import pandas as pd

/opt/miniconda3/lib/python3.7/site-packages/sklearn/__init__.py in <module>
     78     from . import _distributor_init  # noqa: F401
     79     from . import __check_build  # noqa: F401
---> 80     from .base import clone
     81     from .utils._show_versions import show_versions
     82 

/opt/miniconda3/lib/python3.7/site-packages/sklearn/base.py in <module>
     19 from . import __version__
     20 from ._config import get_config
---> 21 from .utils import _IS_32BIT
     22 from .utils.validation import check_X_y
     23 from .utils.validation import check_array

/opt/miniconda3/lib/python3.7/site-packages/sklearn/utils/__init__.py in <module>
     21 
     22 from .murmurhash import murmurhash3_32
---> 23 from .class_weight import compute_class_weight, compute_sample_weight
     24 from . import _joblib
     25 from ..exceptions import DataConversionWarning

/opt/miniconda3/lib/python3.7/site-packages/sklearn/utils/class_weight.py in <module>
      5 import numpy as np
      6 
----> 7 from .validation import _deprecate_positional_args
      8 
      9 

/opt/miniconda3/lib/python3.7/site-packages/sklearn/utils/validation.py in <module>
     24 from contextlib import suppress
     25 
---> 26 from .fixes import _object_dtype_isnan
     27 from .. import get_config as _get_config
     28 from ..exceptions import NonBLASDotWarning, PositiveSpectrumWarning

/opt/miniconda3/lib/python3.7/site-packages/sklearn/utils/fixes.py in <module>
     16 import scipy.sparse as sp
     17 import scipy
---> 18 import scipy.stats
     19 from scipy.sparse.linalg import lsqr as sparse_lsqr  # noqa
     20 from numpy.ma import MaskedArray as _MaskedArray  # TODO: remove in 0.25

/opt/miniconda3/lib/python3.7/site-packages/scipy/stats/__init__.py in <module>
    382 from __future__ import division, print_function, absolute_import
    383 
--> 384 from .stats import *
    385 from .distributions import *
    386 from .morestats import *

/opt/miniconda3/lib/python3.7/site-packages/scipy/stats/stats.py in <module>
    177 
    178 from scipy._lib.six import callable, string_types
--> 179 from scipy.spatial.distance import cdist
    180 from scipy.ndimage import measurements
    181 from scipy._lib._version import NumpyVersion

/opt/miniconda3/lib/python3.7/site-packages/scipy/spatial/__init__.py in <module>
     97 from .kdtree import *
     98 from .ckdtree import *
---> 99 from .qhull import *
    100 from ._spherical_voronoi import SphericalVoronoi
    101 from ._plotutils import *

ImportError: dlopen(/opt/miniconda3/lib/python3.7/site-packages/scipy/spatial/qhull.cpython-37m-darwin.so, 2): Library not loaded: @rpath/libopenblas.dylib
  Referenced from: /opt/miniconda3/lib/python3.7/site-packages/scipy/spatial/qhull.cpython-37m-darwin.so
  Reason: image not found

Как мне это исправить? Я пробовал переустановить / обновить sklearn, но это не сработало. Я также попытался сделать что-то с deeppavlov и получить предупреждение, связанное с этим, когда я пытаюсь

pip install scikit-learn == 0.21.3

...