在conda环境中导入catboost ubuntu18.04时出错

时间:2019-09-30 05:04:22

标签: python-3.x conda catboost

导入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__'

0 个答案:

没有答案