Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy
 

How to install xgboost via python pip




xgboost - XGBoost Python Package, it belongs to Classifiers:

- License :: OSI Approved :: Apache Software License
- Programming Language :: Python :: 3.1
- Programming Language :: Python :: 3.10

When you know about this project and you want to new install xgboost to support your project or you get trouble as ModuleNotFoundError: No module named "xgboost" or ImportError: cannot import name "xgboost" in your project, let follow this tutorial to install xgboost



Installation:

Step 1: First, ensure you installed pip in your os, to check pip has been installed on your computer

In Windows (CMD):

py -m pip --version

In Unix/macOS:

python3 -m pip --version

Ensure pip, setuptools, and wheel are up to date:

In Windows (CMD):

py -m pip install --upgrade pip setuptools wheel

In Unix/macOS:

python3 -m pip install --upgrade pip setuptools wheel


Optional - If you want to install in virtual environment:

In Windows (CMD):

- Install virtualenv - if you installed it, please ignore

py -m pip install --user virtualenv

- Create a virtual environment

py -m venv test_xgboost_env

- Active the virtual environment

test_xgboost_env\Scripts\active

In Unix/macOS:

- Install virtualenv - if you installed it, please ignore

pip3 install virtualenv

- Create a virtual environment

python3 -m venv test_xgboost_env

- Active the virtual environment

source test_xgboost_env/bin/active


Step 2: OK, now, let flow below content to start the installation xgboost

To install xgboost on Windows(CMD):

py -m pip install xgboost

To install xgboost on Unix/macOs:

pip install xgboost


Step 3: If you want to install a specific xgboost version, add ==<xgboost version> to the end command line

Example:

pip install xgboost==0.4a12                                                        pre-release


Please see the version list below table:

VersionReleased dateCommand
xgboost 1.6.12022-05-09T09:31:53Windows:

py -m pip install xgboost==1.6.1

Unix/macOs:

pip install xgboost==1.6.1

xgboost 1.6.02022-04-16T04:09:35Windows:

py -m pip install xgboost==1.6.0

Unix/macOs:

pip install xgboost==1.6.0

xgboost 1.5.22022-01-17T16:17:38Windows:

py -m pip install xgboost==1.5.2

Unix/macOs:

pip install xgboost==1.5.2

xgboost 1.5.12021-11-24T19:51:13Windows:

py -m pip install xgboost==1.5.1

Unix/macOs:

pip install xgboost==1.5.1

xgboost 1.5.02021-10-17T17:15:49Windows:

py -m pip install xgboost==1.5.0

Unix/macOs:

pip install xgboost==1.5.0

xgboost 1.4.22021-05-13T11:49:10Windows:

py -m pip install xgboost==1.4.2

Unix/macOs:

pip install xgboost==1.4.2

xgboost 1.4.12021-04-20T01:45:33Windows:

py -m pip install xgboost==1.4.1

Unix/macOs:

pip install xgboost==1.4.1

xgboost 1.4.02021-04-12T18:26:19Windows:

py -m pip install xgboost==1.4.0

Unix/macOs:

pip install xgboost==1.4.0

xgboost 1.3.32021-01-20T13:31:37Windows:

py -m pip install xgboost==1.3.3

Unix/macOs:

pip install xgboost==1.3.3

xgboost 1.3.22021-01-18T05:41:21Windows:

py -m pip install xgboost==1.3.2

Unix/macOs:

pip install xgboost==1.3.2

xgboost 1.3.12020-12-22T09:01:48Windows:

py -m pip install xgboost==1.3.1

Unix/macOs:

pip install xgboost==1.3.1

xgboost 1.3.0.post02020-12-09T18:22:42Windows:

py -m pip install xgboost==1.3.0.post0

Unix/macOs:

pip install xgboost==1.3.0.post0

xgboost 1.2.12020-10-14T01:11:52Windows:

py -m pip install xgboost==1.2.1

Unix/macOs:

pip install xgboost==1.2.1

xgboost 1.2.02020-08-23T02:46:01Windows:

py -m pip install xgboost==1.2.0

Unix/macOs:

pip install xgboost==1.2.0

xgboost 1.1.12020-06-07T04:14:35Windows:

py -m pip install xgboost==1.1.1

Unix/macOs:

pip install xgboost==1.1.1

xgboost 1.1.02020-05-17T08:23:22Windows:

py -m pip install xgboost==1.1.0

Unix/macOs:

pip install xgboost==1.1.0

xgboost 1.0.22020-03-04T01:26:30Windows:

py -m pip install xgboost==1.0.2

Unix/macOs:

pip install xgboost==1.0.2

xgboost 1.0.12020-02-21T17:08:10Windows:

py -m pip install xgboost==1.0.1

Unix/macOs:

pip install xgboost==1.0.1

xgboost 1.0.02020-02-20T05:19:04Windows:

py -m pip install xgboost==1.0.0

Unix/macOs:

pip install xgboost==1.0.0

xgboost 0.902019-05-20T21:41:06Windows:

py -m pip install xgboost==0.90

Unix/macOs:

pip install xgboost==0.90

xgboost 0.822019-03-05T05:29:53Windows:

py -m pip install xgboost==0.82

Unix/macOs:

pip install xgboost==0.82

xgboost 0.812018-11-05T20:07:16Windows:

py -m pip install xgboost==0.81

Unix/macOs:

pip install xgboost==0.81

xgboost 0.802018-08-14T04:36:08Windows:

py -m pip install xgboost==0.80

Unix/macOs:

pip install xgboost==0.80

xgboost 0.72.12018-07-08T20:18:56Windows:

py -m pip install xgboost==0.72.1

Unix/macOs:

pip install xgboost==0.72.1

xgboost 0.712018-04-11T12:54:50Windows:

py -m pip install xgboost==0.71

Unix/macOs:

pip install xgboost==0.71

xgboost 0.7.post42018-03-26T06:48:01Windows:

py -m pip install xgboost==0.7.post4

Unix/macOs:

pip install xgboost==0.7.post4

xgboost 0.7.post32018-01-02T10:37:31Windows:

py -m pip install xgboost==0.7.post3

Unix/macOs:

pip install xgboost==0.7.post3

xgboost 0.7.post22018-01-01T17:22:39Windows:

py -m pip install xgboost==0.7.post2

Unix/macOs:

pip install xgboost==0.7.post2

xgboost 0.7.post12018-01-01T14:48:07Windows:

py -m pip install xgboost==0.7.post1

Unix/macOs:

pip install xgboost==0.7.post1

xgboost 0.72018-01-01T14:35:56Windows:

py -m pip install xgboost==0.7

Unix/macOs:

pip install xgboost==0.7

xgboost 0.62016-08-09T07:20:17Windows:

py -m pip install xgboost==0.6

Unix/macOs:

pip install xgboost==0.6


Step 4: Otherwise, you can install xgboost from local archives:

Download the distribution file from xgboost-1.6.1.tar.gz or the specific xgboost version in the below list of distribution

After that, install by command:

On Windows(CMD):

py -m pip install <path_to_xgboost_downloaded_file>

On Unix/macOs:

pip install <path_to_xgboost_downloaded_file>


List distribution:


Project link:

- Homepage