我正在使用python 3.4并安装了catboost库,但是当我尝试导入时,它会显示以下错误。
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.
答案 0 :(得分:1)
您可以
!pip3安装catboost
然后
从catboost导入CatBoostClassifier
答案 1 :(得分:0)
因为您正在使用python 3.x,所以需要使用
pip3 install catboost
不
pip install catboost
答案 2 :(得分:0)
尝试干净地卸载,然后再次重新安装catboost。我通过此方法解决了该错误。
答案 3 :(得分:0)
catboost模块,请尝试安装它 pip3 install catboost(在ubuntu终端或python终端中)。 它对我有用!