简体   繁体   English

AttributeError:类型对象“sklearn.tree._criterion.array”没有属性“__reduce_cython__”

[英]AttributeError: type object 'sklearn.tree._criterion.array' has no attribute '__reduce_cython__'

I want to import from sklearn.tree import DecisionTreeRegressor in jupyter.我想from sklearn.tree import DecisionTreeRegressor在 jupyter 中from sklearn.tree import DecisionTreeRegressor but when I run just the line contains above import, I got this error.但是当我只运行包含上面导入的行时,我收到了这个错误。

<ipython-input-16-28b3e81cd98d> in <module>
----> 1 from sklearn.tree import DecisionTreeRegressor

~/.local/lib/python3.6/site-packages/sklearn/tree/__init__.py in <module>
      4 """
      5 
----> 6 from ._classes import BaseDecisionTree
      7 from ._classes import DecisionTreeClassifier
      8 from ._classes import DecisionTreeRegressor

~/.local/lib/python3.6/site-packages/sklearn/tree/_classes.py in <module>
     38 from ..utils.validation import check_is_fitted
     39 
---> 40 from ._criterion import Criterion
     41 from ._splitter import Splitter
     42 from ._tree import DepthFirstTreeBuilder

~/.local/lib/python3.6/site-packages/sklearn/tree/_criterion.cpython-36m-x86_64-linux-gnu.so in init sklearn.tree._criterion()

AttributeError: type object 'sklearn.tree._criterion.array' has no attribute '__reduce_cython__'

I tried to install scipy and update scikit-learn by conda but it didn't solved.我尝试通过 conda 安装 scipy 并更新 scikit-learn,但没有解决。

尝试更新 Cython :

pip install cython

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AttributeError: 类型对象 &#39;sklearn.tree._tree.TreeBuilder&#39; 没有属性 &#39;__reduce_cython__&#39; - AttributeError: type object 'sklearn.tree._tree.TreeBuilder' has no attribute '__reduce_cython__' AttributeError:类型对象“sklearn.manifold._barnes_hut_tsne.array”没有属性“__reduce_cython__” - AttributeError: type object 'sklearn.manifold._barnes_hut_tsne.array' has no attribute '__reduce_cython__' AttributeError: type object &#39;spacy.syntax.nn_parser.array&#39; 没有属性 &#39;__reduce_cython__&#39; ,(向虚拟环境添加路径) - AttributeError: type object 'spacy.syntax.nn_parser.array' has no attribute '__reduce_cython__' , (adding Paths to virtual environments) AttributeError: type object &#39;h5py.h5r.Reference&#39; 没有属性 &#39;__reduce_cython__&#39; - AttributeError: type object 'h5py.h5r.Reference' has no attribute '__reduce_cython__' AttributeError:类型 object 'netCDF4._netCDF4._MemBuf' 没有属性 '__reduce_cython__' - AttributeError: type object 'netCDF4._netCDF4._MemBuf' has no attribute '__reduce_cython__' AttributeError:类型 object 'pandana.cyaccess.cyaccess' 没有属性 '__reduce_cython__' - AttributeError: type object 'pandana.cyaccess.cyaccess' has no attribute '__reduce_cython__' AttributeError: type object 'h5py.h5.H5PYConfig' has no attribute '__reduce_cython__', while using Tensorflow Object 检测API - AttributeError: type object 'h5py.h5.H5PYConfig' has no attribute '__reduce_cython__', while using Tensorflow Object detection API 导入 modin.pandas 导致错误:AttributeError:类型 object 'pyarrow.lib.Message' 没有属性 '__reduce_cython__' - import modin.pandas causes ERROR: AttributeError: type object 'pyarrow.lib.Message' has no attribute '__reduce_cython__' “gensim._matutils.array”没有属性“__reduce_cython__” - 'gensim._matutils.array' has no attribute '__reduce_cython__' AttributeError:类型对象“ h5py.h5r.Reference”在使用“从keras.utils导入HDF5Matrix”时没有属性“ __reduce_cython__” - AttributeError: type object 'h5py.h5r.Reference' has no attribute '__reduce_cython__' on using “from keras.utils import HDF5Matrix”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM