运行代码行时:
import xgboost
我收到以下警告:
DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.
“此模块将在0.20中删除。”,DeprecationWarning)
我使用以下方法安装了xgboost:
conda install py-xgboost
我使用pycharm。我该怎么做才能运行xgboost?
修改: 这是完整的错误代码:
C:\Users\username\Miniconda3\python.exe "C:/Users/username/Documents/Tools/BigData/Kaggle ML Course/main2.py"
C:\Users\username\Miniconda3\lib\site-packages\sklearn\cross_validation.py:41: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.
"This module will be removed in 0.20.", DeprecationWarning)
Traceback (most recent call last):
File "C:/Users/username/Documents/Tools/BigData/Kaggle ML Course/main2.py", line 1, in <module>
import xgboost
File "C:\Users\username\Miniconda3\lib\site-packages\xgboost\__init__.py", line 11, in <module>
from .core import DMatrix, Booster
File "C:\Users\username\Miniconda3\lib\site-packages\xgboost\core.py", line 112, in <module>
_LIB = _load_lib()
File "C:\Users\username\Miniconda3\lib\site-packages\xgboost\core.py", line 106, in _load_lib
lib = ctypes.cdll.LoadLibrary(lib_path[0])
File "C:\Users\username\Miniconda3\lib\ctypes\__init__.py", line 426, in LoadLibrary
return self._dlltype(name)
File "C:\Users\username\Miniconda3\lib\ctypes\__init__.py", line 348, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application
答案 0 :(得分:-1)
conda update应该是这种情况下的预期操作并禁止警告..让我知道它是否有效。