Similar non-duplicate posts:
- How to install xgboost package in python (windows platform)?
- XGBoost installation issues for Python Anaconda Windows 10 (18 May 2018)
I looked around through multiple Stack Overflow posts about installing xgboost
for Python on Windows 10, but none of them mentioned the issue I was having. In addition, all the posts seem to be about installing xgboost
without GPU support.
I also found the official installation guide to be quite difficult to follow, as it omits certain directory changes and has some different options that disrupt the flow of commands. Below are the steps I used to install xgboost
with GPU support on Windows 10 with Python 3.6.4:
Necessary software
The first step is to install the following software that will be required for this installation:
- CMake, adding CMake to your system
PATH
- Visual Studio 2015 with Update 3 and Visual C++
- Git for Windows, making sure to add it to the
PATH
variable - CUDA Note: the version must be at least 8.0. I used 9.0 because of compatibility issues with the newer versions and Tensorflow
Ensure the following packages are installed:
conda install -y numpy scipy pandas matplotlib nose scikit-learn graphviz python-graphviz
Step 1: Cloning the repo
Run the following in the VS2015 x64 Native Tools Command Prompt that comes installed with VS2015 in administrator mode, in the folder you want the xgboost
folder to be located in:
git clone --recursive https://github.com/dmlc/xgboost
cd xgboost
git submodule init
git submodule update
Step 2: Making the .sln file with CMake
mkdir build
cd build
cmake .. -G "Visual Studio 14 2015 Win64" -DUSE_CUDA=ON
cmake --build . --target xgboost --config Release
Step 3: Installing the Python Package
If the above complete without any errors, run the following:
cd ../python-package
python setup.py install
Error:
At this point, I get the following error and the installation fails:
error: can't copy 'xgboost\lib': doesn't exist or not a regular file
See my answer below for my solution, and please post another answer if you find a better way to solve this problem.