机器学习笔记之Anaconda中命令形式安装XGBoost(pip install)

0x00 概述

在没有安装XGBoost之前,import xgboot会出错,如下:

# ModuleNotFoundError: No module named ‘xgboost’

 

 

0x01 安装xgboost

前提条件:
windows环境下,anaconda(这里指的是Anaconda3)已安装,相应的numpy和sicpy已安装

下面介绍最简单的安装方式:

打开Anaconda Prompt
输入命令 :

# pip install xgboost -i https://pypi.tuna.tsinghua.edu.cn/simple

“-i https://pypi.tuna.tsinghua.edu.cn/simple” 这是清华镜像,包从这里下载,速度比较快;否则,默认国外的镜像,下载速度慢,可能会安装失败。
效果如下:

到这里无论是系统的python或者还是jupyter都可以使用xgboost包了。

 

posted @ 2019-12-22 20:43  时光飞逝,逝者如斯  阅读(5572)  评论(0编辑  收藏  举报