如何在python(Windows平台)中安装xgboost软件包? [英] How to install xgboost package in python (windows platform)?
问题描述
http://xgboost.readthedocs.org/en/latest/python/python_intro.html
在xgboost的主页上(上面的链接),它说: 要安装XGBoost,请执行以下步骤:
On the homepage of xgboost(above link), it says: To install XGBoost, do the following steps:
-
您需要运行
在项目的根目录
You need to run
make
in the root directory of the project
在python-package目录中运行
In the python-package directory run
python setup.py install
python setup.py install
但是,当我这样做时,对于第1步,会出现以下错误: 令:术语制作"未被识别为cmdlet,函数,脚本文件或可操作的程序的名称.检查 名的拼写,或者是否包含一路径,验证路径是否正确并再次尝试.
However, when I did it, for step 1 the following error appear: make : The term 'make' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
然后我跳过了步骤1,直接执行了步骤2,出现了另一个错误:
then I skip step1 and did step 2 directly, another error appear:
Traceback (most recent call last):
File "setup.py", line 19, in <module>
LIB_PATH = libpath['find_lib_path']()
File "xgboost/libpath.py", line 44, in find_lib_path
'List of candidates:\n' + ('\n'.join(dll_path)))
__builtin__.XGBoostLibraryNotFound: Cannot find XGBoost Libarary in the candicate path, did you install compilers and run build.sh in root path?
有人知道如何在Windows10平台上为python安装xgboost吗?感谢您的帮助!
Does anyone know how to install xgboost for python on Windows10 platform? Thanks for your help!
推荐答案
我成功在Windows 8 64位安装XGBoost,Python的2.7与Visual Studio 2013(不需要mingw64)
I installed XGBoost successfully in Windows 8 64bit, Python 2.7 with Visual Studio 2013 (don't need mingw64)
更新了15/02/2017
使用XGBoost的较新的版本,在这里是我的步骤
With newer version of XGBoost, here are my steps
<强>步骤1.安装cmake的 https://cmake.org/download/
验证
Verify cmake
have been installed successfully
$ cmake
Usage
cmake [options] <path-to-source>
cmake [options] <path-to-existing-build>
...
第2步.克隆xgboost源
Step 2. Clone xgboost source
$ git clone https://github.com/dmlc/xgboost xgboost_dir
<强>第3步.创建Visual Studio项目
Step 3. Create Visual Studio Project
$ cd xgboost_dir
$ mkdir build
$ cd build
$ cmake .. -G"Visual Studio 12 2013 Win64"
<强>第4步.强>构建的Visual Studio 2013项目
Step 4. Build Visual Studio 2013 project
- 使用Visual Studio 2013打开文件
xgboost_dir/build/ALL_BUILD.vcxproj
- 在Visual Studio 2013中,打开
BUILD > Configuration Manager...
- 在活动解决方案配置中选择发布
- 选择的x64在Active溶液平台
- Open file
xgboost_dir/build/ALL_BUILD.vcxproj
with Visual Studio 2013 - In Visual Studio 2013, open
BUILD > Configuration Manager...
- choose Release in Active solution configuration
- choose x64 in Active solution platform
在构建解决方案,两个新文件
和 在夹 After build solution, two new files
libxgboost.dll
andxgboost.exe
are created in folderxgboost_dir/lib
第5步.构建python包
- 复制文件
至 - 目录更改为
文件夹 - 运行命令
python setup.py install
验证xgboost是否已成功安装
Verify xgboost have been installed successfully
$ python -c "import xgboost"
旧答案
这是我的步骤:
- GIT中克隆 https://github.com/dmlc/xgboost
- git checkout 9bc3d16
- 打开项目在
与Visual Studio 2013 - 在Visual Studio 2013,开
- 在
Active solution configuration
中选择 - 在
Active solution platform
中选择
Release
x64
- 在
- git clone https://github.com/dmlc/xgboost
- git checkout 9bc3d16
- Open project in
xgboost/windows
with Visual Studio 2013 - In Visual Studio 2013, open
BUILD > Configuration Manager...
,- choose
Release
inActive solution configuration
- choose
x64
inActive solution platform
- choose
这篇关于如何在python(Windows平台)中安装xgboost软件包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!