0

导入 catboost 时出错。从 catboost 导入 CatBoostRegressor。

我在 ubuntu 上使用 conda。按照官方网站上建议的方式安装 catboost。但是在导入时遇到错误。

AttributeError                            Traceback (most recent call last)
<ipython-input-45-d222a454d36a> in <module>()
----> 1 from catboost import CatBoostRegressor

~/anaconda3/lib/python3.6/site-packages/catboost/__init__.py in <module>()
----> 1 from .core import FeaturesData, EFstrType, Pool, CatBoost, CatBoostClassifier, 
CatBoostRegressor, CatboostError, cv, train, sum_models  # noqa
  2 from .version import VERSION as __version__  # noqa
  3 __all__ = ['FeaturesData', 'EFstrType', 'Pool', 'CatBoost', 'CatBoostClassifier', 
'CatBoostRegressor', 'CatboostError', 'cv', 'train', 'sum_models']
  4 
  5 try:

~/anaconda3/lib/python3.6/site-packages/catboost/core.py in <module>()
 50 
 51 
---> 52 _catboost = get_catboost_bin_module()
 53 _PoolBase = _catboost._PoolBase
 54 _CatBoost = _catboost._CatBoost

~/anaconda3/lib/python3.6/site-packages/catboost/core.py in get_catboost_bin_module()
 41     for so_path in so_paths:
 42         try:
---> 43             loaded_catboost = imp.load_dynamic('_catboost', so_path)
 44             sys.modules['catboost._catboost'] = loaded_catboost
 45             return loaded_catboost

~/anaconda3/lib/python3.6/imp.py in load_dynamic(name, path, file)
341         spec = importlib.machinery.ModuleSpec(
342             name=name, loader=loader, origin=path)
--> 343         return _load(spec)
344 
345 else:

_catboost.pyx in init _catboost()
AttributeError: type object '_catboost.Py_ITypedSequencePtr' has no attribute 
'__reduce_cython__'
4

0 回答 0