The story that XGBoost was finally installed

I couldn't get an error when I tried to insert XGBoost, but I managed to succeed.

Previously, I could not execute the following ↓ command with Anaconda Prompt.

conda install -c anaconda py-xgboost

Recorded because it turned out that I had to enter the above code with other programs to install XGBoost. I will make a memorandum of the installation method, so I hope it helps people in the same situation.

environment

・ Windows 10 (64bit) -Python 3.6 ・ Anaconda

1. Download and uncompress the compressed file containing the gfortran compiler

Download the "compressed file" containing the gfortran compiler from sourceforge's HP and unzip it

The "compressed files" go to the bottom of sourceforge.net HP and go to "x86_64-posix-sjlj" (https://sourceforge.net/projects/mingw-w64/files/?source=navbar) Click the one surrounded by the red frame in the photo to download. image001.png

x86_64-8.1.0-release-posix-sjlj-rt_v6-rev0.7z will be downloaded, so unzip it. (If you don't have the decompression software, download the decompression software for free from 7-Zip etc.) After decompressing, Explorer creates an x86_64-*** folder as shown below, and there is a mingw64 folder in it. Furthermore, expand the mingw64 folder, and expand the bin folder inside it. (Not required if already deployed) image.png Copy the address of the bin folder. (In the case of the photo ↑, "C: \ Program Files \ x86_64-8.1.0-release-posix-sjlj-rt_v6-rev0 \ mingw64 \ bin")

2. Set PATH

To use GCC included in MinGW-w64 from any directory, it is necessary to set PATH. Click the Start menu at the bottom left of the desktop, and click "Windows System Tools" in the displayed list of apps. image.png Click "Control Panel" from the displayed. image.png When "Control Panel" is displayed, click "System and Security". image.png Click "System" on the next screen image.png When the "System" screen is displayed, click "Advanced system settings" in the left menu. image.png The System Properties screen is displayed. Click "Environment Variables" image.png The "Environment Variables" screen is displayed. Find the system environment variable whose "variable" is written as "Path", click once to select the part where "Path" is written, and then click the "Edit" button. image.png On the "Edit Environment Variable Name" screen, click "New" in the upper right. Enter according to the MinGW-w64 directory you copied earlier. (In the above example, enter "C: \ pg \ mingw-w64 \ x86_64-8.1.0-posix-seh-rt_v6-rev0 \ mingw64 \ bin") image.png Now, the PATH used by GCC has been added to the value previously set in PATH. Start a command prompt, enter "gcc -v" in any directory, and execute it to confirm.

gcc -v

3. 3. Make Git available from the command line.

If you can already use it, go to 4.

Download the latest version of the exe file from Site (downloadable from the red frame in the photo). ![https ___qiita-image-store.s3.amazonaws.com_0_81226_b7769f2c-8845-cb02-209f-3c3903fcdae1.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/479337 /364aa5bb-5728-be85-638a-81444dc04754.jpeg) Installation. s.jpg

I want to use it from the command line, so select "Use Git from the Windows Command Prompt" etc. and click Next. a.jpg image.png

Installation confirmation. Start the command prompt and execute the following command.

git --version

If the version is displayed, the installation is successful. Now you can use Git from the command line. image.png

4. Compile to use XGBoost

Start a command prompt and git clone at the command prompt.

git clone --recursive https://github.com/dmlc/xgboost
cd xgboost
git checkout 9a48a40
git submodule init
git submodule update

Now run the following command in Anaconda Prompt.

conda install -c anaconda py-xgboost

You will be asked y / n, so select y and it will be installed. After installation, use an editor such as jupyter

import xgboost as xgb

Enter and execute, and if there is no error, it succeeds. XGBoost can be used.

Recommended Posts

The story that XGBoost was finally installed
The story that the Homebrew environment was blown away when Anaconda was installed
The story that the return value of tape.gradient () was None
The story that Japanese output was confused with Django
The story that my pull request was incorporated into Scipy
The story that the new drawing library "HiPlot" was pretty good
The story that the version of python 3.7.7 was not adapted to Heroku
The story that the guard was confined when the laboratory was converted to IoT
The story that FastAPI may take supremacy
Finally the enum was introduced .. It's slow ..
Asynchronous API that combines API Gateway and Step Functions was the strongest story
The story that Apache dealt with because it was down at AH00144
About the matter that was worried about sampling error
The story that fits in with pip installation
Solved the problem that MacVim installed by Homebrew was not built by python of pyenv
A story that Seaborn was easy, convenient and impressed
A story that reduces the effort of operation / maintenance
A story that struggled with the common set HTTP_PROXY = ~
The story that Kivy's Japanese input characters are displayed
A story that I was addicted to at np.where
A story that analyzed the delivery of Nico Nama.
A story that was terrible if SELinux was properly disabled
The story that yapf did not work in vscode
A story about PHP that was okay in the development environment but buggy in the production environment LEVEL 1-3 + 1
The story of sys.path.append ()
The story that `while queue` did not work in python
The story that Python stopped working with VS Code (Windows 10)
The story that the private key is set to 600 with chmod