Win10 system 64-bit installation method of xgboost 0.6

The principle introduction of xgboost, etc., will not be repeated here. I will only talk about the problems encountered in installing the latest xgboost (0.6) under the win10 system and the screenshots of relevant details. After all, there are pictures before the truth. Hope the steps can be used for your reference.

1. First of all, the official documents are indispensable, click on the official xgboost tutorial . Switch directly to the Windows installation according to the directory on the left.
2. It should be noted that I am using python3.5 version, see online tutorials, other versions are also available, and to install various necessary tools such as numpy, you can also choose integrated packages such as anaconda to install. Regarding the Python installation and environment variable configuration, I will not repeat them here.

3. Install Git for Windows . After the installation is complete, you can find several menus in the start menu as shown in the figure below. The more commonly used one is Git Bash. The Git Bash Here option can appear with the right mouse button at any file location, thereby opening the command line.

4. Use the git command to clone the xgboost source file.
Right-click in the root directory of the disk (C, D, and E drives are fine, but the root directory is best), select Git Bash Here, open the git command line, and type
git clone --recursive https://github.com/dmlc/xgboost
The --recursive option is very important, don't ignore it. After a while, an xgboost folder will be generated in the root directory of the disk. Its directory structure is as follows:


5. Initialize the installation process, continue to enter in the gitbash command line
git submodule init
git submodule update

Regarding the method of installing with MSVC and MinGW mentioned in the official tutorial , I have tried without success, so I only use the second method directly, which is to compile with Visual Studio 2013 (other versions can also be used, as explained below), go to See the specific steps below.
6. Download cmake, address https://cmake.org/download/, I choose to use cmake-3.9.0-rc5-win64-x64.msi to install in this way, the purpose is to facilitate the configuration of environment variables, pay attention to the installation process Choose the option to write to environment variables.

7. Download and install Visual Studio 2015. You can also use other versions. The example on the official website is the 2013 version. Note that when installing, you do not need to install it completely. You only need to install the components related to c compilation.
8. Continue to go back to the official documentation, (mainline task), and enter the following codes in turn in gitbash
mkdir build
cd build
cmake .. -G"Visual Studio 12 2013 Win64"
 If you are using Visual Studio 2015, the above should be changed to Visual Studio 14 2015 Win64, see the instructions in the red box below for details



After execution, a series of files will be generated in D:\xgboost\build, that is, the newly created build folder, as shown in the figure below

7. Open xgboost.sln in Visual Studio and operate as shown. Set Release X64, on the solution xgboost, right mouse button, generate the solution


8. Three files will be generated in the D:\xgboost\build\Release directory, among which xgboost.lib is the key file used to install xgboost in the next step, copy it to
D:\xgboost\python-package\xgboost directory
9. After doing so many preparations, you can finally install xgboost. Execute the following code and display the installation process according to the screenshot.
cd python-package; python setup.py install


10. After the installation is complete, submit a test screenshot




ps: The switching of various paths in the command line has to be observed by yourself. Always be aware of your current directory location

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325993493&siteId=291194637