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.
・ Windows 10 (64bit) -Python 3.6 ・ Anaconda
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.
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) 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")
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. Click "Control Panel" from the displayed. When "Control Panel" is displayed, click "System and Security". Click "System" on the next screen When the "System" screen is displayed, click "Advanced system settings" in the left menu. The System Properties screen is displayed. Click "Environment Variables" 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. 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") 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
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.
I want to use it from the command line, so select "Use Git from the Windows Command Prompt" etc. and click Next.
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.
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