【发布时间】:2018-02-17 09:55:34
【问题描述】:
运行代码行时:
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 中删除。”,弃用警告)
我已经安装了 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.20 版本中删除模块,但现在你可以使用它。
-
警告后我无能为力,程序停止
-
您可以随时使用“conda update”更新软件包
-
我今天安装了它,所以它肯定会更新。我有 miniconda,所以我需要 anaconda?
标签: python import conda xgboost