如何在 Windows 上的 python 中安装 XGBoost 包 [英] How can I install XGBoost package in python on Windows

查看:25
本文介绍了如何在 Windows 上的 python 中安装 XGBoost 包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在 python 中安装 XGBoost 包.我正在使用 windows os, 64bits .我经历了以下.

I tried to install XGBoost package in python. I am using windows os, 64bits . I have gone through following.

包目录指出 xgboost 对于 windows 不稳定并且被禁用:Windows 上的 pip 安装目前已禁用以进行进一步调查,请从 github 安装.https://pypi.python.org/pypi/xgboost/

The package directory states that xgboost is unstable for windows and is disabled: pip installation on windows is currently disabled for further invesigation, please install from github. https://pypi.python.org/pypi/xgboost/

我不精通 Visual Studio,在构建 XGBoost 时遇到问题.我错过了在数据科学中使用 xgboost 包的机会.

I am not well versed in Visual Studio, facing problem building XGBoost. I am missing opportunities to utilize xgboost package in data science.

请指导,以便我可以在python中导入XGBoost包.

Please guide, so that I can import the XGBoost package in python.

谢谢

推荐答案

如果您使用的是 anaconda(或 miniconda),您可以使用以下内容:

If you are using anaconda (or miniconda) you can use the following:

  • conda install -c anaconda py-xgboost 2019-09-20 更新
  • 文档

检查安装方式:

  • 激活环境(见下文)
  • 运行conda list

激活环境:

在 Windows 上,在您的 Anaconda Prompt 中,运行(假设您的环境名为 myenv):

On Windows, in your Anaconda Prompt, run (assumes your environment is named myenv):

  • 激活 myenv

在 macOS 和 Linux 上,在您的终端窗口中,运行(假设您的环境名为 myenv):

On macOS and Linux, in your Terminal Window, run (assumes your environment is named myenv):

  • source activate myenv

Conda 将路径名 myenv 添加到您的系统命令中.

Conda prepends the path name myenv onto your system command.

这篇关于如何在 Windows 上的 python 中安装 XGBoost 包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆