ImportError: No module named '_catboost'

suryansh pandey picture suryansh pandey · Nov 14, 2017 · Viewed 8k times · Source

I am using python 3.4 and have installed catboost library but when i try to import, it shows the following error.


ImportError                               Traceback (most recent call last)
c:\python34\lib\site-packages\catboost\core.py in <module>()
 17 try:
---> 18     from _catboost import _PoolBase, _CatBoostBase, CatboostError, 
_cv, _set_logger, _reset_logger
 19 except ImportError:

ImportError: No module named '_catboost'

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
<ipython-input-51-f6570a454eaf> in <module>()
----> 1 from catboost import CatBoostClassifier,cv, Pool

c:\python34\lib\site-packages\catboost\__init__.py in <module>()
----> 1 from .core import Pool, CatBoost, CatBoostClassifier, 
CatBoostRegressor, CatboostError, cv  # noqa
  2 try:
  3     from .widget import CatboostIpythonWidget  # noqa
  4 except:
  5     pass

c:\python34\lib\site-packages\catboost\core.py in <module>()
 18     from _catboost import _PoolBase, _CatBoostBase, CatboostError, _cv, 
_set_logger, _reset_logger
 19 except ImportError:
---> 20     from ._catboost import _PoolBase, _CatBoostBase, CatboostError, 
_cv, _set_logger, _reset_logger
 21 
 22 from contextlib import contextmanager

ImportError: DLL load failed: The specified module could not be found.

Answer

Sami Navesi picture Sami Navesi · Mar 4, 2020

you may

!pip3 install catboost

and then

from catboost import CatBoostClassifier