http://xgboost.readthedocs.org/en/latest/python/python_intro.html
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
In the python-package directory run
python setup.py install
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.
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?
Does anyone know how to install xgboost for python on Windows10 platform? Thanks for your help!
In case anyone's looking for a simpler solution that doesn't require compiling it yourself:
cd
to your Downloads folder (or wherever you saved the whl file)pip install xgboost-0.6-cp35-cp35m-win_amd64.whl
(or whatever your whl file is named)If you find it won't install because of a missing dependency, download and install the dependency first and retry.
If it complains about access permissions, try opening your command prompt as Administrator and retry.
This gives you xgboost and the scikit-learn wrapper, and saves you from having to go through the pain of compiling it yourself. :)
Note that as of the most recent release the Microsoft Visual Studio instructions no longer seem to apply as this link returns a 404 error:
https://github.com/dmlc/xgboost/tree/master/windows
You can read more about the removal of the MSVC build from Tianqi Chen's comment here.
So here's what I did to finish a 64-bit build on Windows:
These should be all the tools you need to build the xgboost project. To get the source code run these lines:
Note that I ran this part from a Cygwin shell. If you are using the Windows command prompt you should be able to change cp to copy and arrive at the same result. However, if the build fails on you for any reason I would recommend trying again using cygwin.
If the build finishes successfully, you should have a file called xgboost.exe located in the project root. To install the Python package, do the following:
Now you should be good to go. Open up Python, and you can import the package with:
import xgboost as xgb
To test the installation, I went ahead and ran the basic_walkthrough.py file that was included in the demo/guide-python folder of the project and didn't get any errors.
I installed XGBoost successfully in Windows 8 64bit, Python 2.7 with Visual Studio 2013 (don't need mingw64)
Updated 15/02/2017
With newer version of XGBoost, here are my steps
Step 1. Install cmake https://cmake.org/download/
Verify cmake
have been installed successfully
$ cmake
Usage
cmake [options] <path-to-source>
cmake [options] <path-to-existing-build>
...
Step 2. Clone xgboost source
$ git clone https://github.com/dmlc/xgboost xgboost_dir
Step 3. Create Visual Studio Project
$ cd xgboost_dir
$ mkdir build
$ cd build
$ cmake .. -G"Visual Studio 12 2013 Win64"
Step 4. Build Visual Studio 2013 project
xgboost_dir/build/ALL_BUILD.vcxproj
with Visual Studio 2013BUILD > Configuration Manager...
After build solution, two new files libxgboost.dll
and xgboost.exe
are created in folder xgboost_dir/lib
Step 5. Build python package
libxgboost.dll
to xgboost_dir/python-package
xgboost_dir/python-package
folderpython setup.py install
Verify xgboost have been installed successfully
$ python -c "import xgboost"
Old Answer
Here are my steps:
xgboost/windows
with Visual Studio 2013BUILD > Configuration Manager...
,
Release
in Active solution configuration
x64
in Active solution platform
xgboost
, xgboost_wrapper
xgboost/windows/x64/Release
folder to xgboost/wrapper
xgboost/python-package
, run command python setup.py install
python -c "import xgboost"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With