4

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.
Beri
  • 11,470
  • 4
  • 35
  • 57
suryansh pandey
  • 41
  • 1
  • 1
  • 2

4 Answers4

3

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

pip3 install catboost

not

pip install catboost
wpercy
  • 9,636
  • 4
  • 33
  • 45
  • I tried uninstalling and then again installed using `pip3 install catboost` 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. – suryansh pandey Nov 15 '17 at 22:26
  • can you post the full traceback as an edit to your question? – wpercy Nov 15 '17 at 22:52
3

you may

!pip3 install catboost

and then

from catboost import CatBoostClassifier

Sami Navesi
  • 160
  • 1
  • 6
0

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

Liang Zulin
  • 343
  • 4
  • 8
0

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!!