ImportError: No module named '_catboost'

Viewed 17142

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.
4 Answers

Because you're using python 3.x you need to use

pip3 install catboost

not

pip install catboost

you may

!pip3 install catboost

and then

from catboost import CatBoostClassifier

Try uninstall cleanly and re-install catboost again. I fix that error by this.

catboost module is present in python package index version 3(pip3).so try to install it pip3 install catboost (either in ubuntu terminal or python terminal). it worked for me!!

Related