在python下安装xgboost,32位msys失败

Moo*_*ama 7 python msys package failed-installation xgboost

试图安装xgboost失败..?该版本是Windows和企业版的Anaconda 2.1.0(64位).我该怎么办?我一直在使用R似乎很容易从RStudio在R中安装新软件包,但是在spyder中不是这样,因为我需要去命令窗口来做它然后在这种情况下它失败了..

import sys

print (sys.version) 
2.7.8 |Anaconda 2.1.0 (64-bit)| (default, Jul  2 2014, 15:12:11) [MSC v.1500 64 bit (AMD64)]

C:\anaconda\Lib\site-packages>pip install -U xgboost
Downloading/unpacking xgboost
  Could not find a version that satisfies the requirement xgboost (from versions: 0.4a12, 0.4a13)
Cleaning up...
No distributions matching the version for xgboost
Storing debug log for failure in C:\Users\c_kazum\pip\pip.log


------------------------------------------------------------
C:\Users\c_kazum\AppData\Local\Continuum\Anaconda\Scripts\pip-script.py run on 08/27/15 12:52:30
Downloading/unpacking xgboost
  Getting page https://pypi.python.org/simple/xgboost/
  URLs to search for versions for xgboost:
  * https://pypi.python.org/simple/xgboost/
  Analyzing links from page https://pypi.python.org/simple/xgboost/
    Found link https://pypi.python.org/packages/source/x/xgboost/xgboost-0.4a12.tar.gz#md5=4d768e034a28590497bb79279f036946 (from https://pypi.python.org/simple/xgboost/), version: 0.4a12
    Found link https://pypi.python.org/packages/source/x/xgboost/xgboost-0.4a13.tar.gz#md5=5f53d51e4305c679192b3cabda2b0dbe (from https://pypi.python.org/simple/xgboost/), version: 0.4a13
  Ignoring link https://pypi.python.org/packages/source/x/xgboost/xgboost-0.4a12.tar.gz#md5=4d768e034a28590497bb79279f036946 (from https://pypi.python.org/simple/xgboost/), version 0.4a12 is a pre-release (use --pre to allow).
  Ignoring link https://pypi.python.org/packages/source/x/xgboost/xgboost-0.4a13.tar.gz#md5=5f53d51e4305c679192b3cabda2b0dbe (from https://pypi.python.org/simple/xgboost/), version 0.4a13 is a pre-release (use --pre to allow).
  Could not find a version that satisfies the requirement xgboost (from versions: 0.4a12, 0.4a13)
Cleaning up...
  Removing temporary dir c:\users\c_kazum\appdata\local\temp\pip_build_c_kazum...
No distributions matching the version for xgboost
Exception information:
Traceback (most recent call last):
  File "C:\Users\c_kazum\AppData\Local\Continuum\Anaconda\lib\site-packages\pip\basecommand.py", line 122, in main
    status = self.run(options, args)
  File "C:\Users\c_kazum\AppData\Local\Continuum\Anaconda\lib\site-packages\pip\commands\install.py", line 278, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "C:\Users\c_kazum\AppData\Local\Continuum\Anaconda\lib\site-packages\pip\req.py", line 1177, in prepare_files
    url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
  File "C:\Users\c_kazum\AppData\Local\Continuum\Anaconda\lib\site-packages\pip\index.py", line 322, in find_requirement
    raise DistributionNotFound('No distributions matching the version for %s' % req)
DistributionNotFound: No distributions matching the version for xgboost
Run Code Online (Sandbox Code Playgroud)

smc*_*mci 2

这是一个 xgboost 问题,而不是您最初标记的 Anaconda 问题(我不使用 Anaconda,但我也遇到了这个问题)。

编辑:从您的更新来看,您的损坏是由路径上某处的 32 位 msys 引起的,而您安装了 64 位 Python。我和所有其他人自 8 月 25 日以来报告的损坏是 0.4a12/3 预发行版:


原始答案 - 根据您提供的有限信息(此处,而不是在 Kaggle 线程上)并且没有详细的失败日志:显然pypi 上 xgboost 的最新版本,0.4a12 和 0.4a13都是预发行版,pip 将默认情况下不使用,除非您这样做pip install --pre xgboost

我通过挖掘 with 发现了这一切pip install -v xgboost,它显示了有关尝试安装失败的原因的有用详细信息(如下);然后使用pip helppip install -h查看所有安装选项:

pip install -v xgboost Downloading/unpacking xgboost   Ignoring link
https://pypi.python.org/packages/source/x/xgboost/xgboost-0.4a12.tar.gz#md5=4d768e034a28590497bb79279f036946
(from https://pypi.python.org/simple/xgboost/), version 0.4a12 is a
pre-release (use --pre to allow).   Ignoring link
https://pypi.python.org/packages/source/x/xgboost/xgboost-0.4a13.tar.gz#md5=5f53d51e4305c679192b3cabda2b0dbe
(from https://pypi.python.org/simple/xgboost/), version 0.4a13 is a
pre-release (use --pre to allow).
Run Code Online (Sandbox Code Playgroud)

然后pip install -h告诉你:

Install Options:
  -e, --editable <path/url>   Install a project in editable mode ...
  ...
  --pre                       Include pre-release and development versions. By default, pip only finds stable versions.
Run Code Online (Sandbox Code Playgroud)

最后:

pip install --pre xgboost
Run Code Online (Sandbox Code Playgroud)

(PS xgboost 维护者于 2015 年 8 月进行了最近的更改