在Anaconda 3 windows-64

时间:2017-04-29 15:27:36

标签: python git mingw anaconda xgboost

我在anaconda 3上安装了xgboost,在windows 10 64位上。我按照https://www.ibm.com/developerworks/community/blogs/jfp/entry/Installing_XGBoost_For_Anaconda_on_Windows?lang=enhttps://dnc1994.com/2016/03/installing-xgboost-on-windows/教程的说明进行操作,但是我没有完成编译过程。

我执行了以下代码(git bash),在这个阶段似乎一切正常:

$ git clone --recursive https://github.com/dmlc/xgboost
$ cd xgboost
$ git submodule init
$ git submodule update

然后,我安装了mingw并添加到路径中:

C:\Program Files\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev2\mingw64\bin

执行以下指令并返回错误:

$ which mingw32-make
$ alias make='mingw32-make'

接下来我尝试执行folling命令(也是git bash),第二步出现错误(make -j4):

$ cd dmlc-core
$ make -j4
$ cd ../rabit
$ make lib/librabit_empty.a -j4
$ cd ..
$ cp make/mingw64.mk config.mk
$ make -j4

我遇到了以下错误:

$ make -j4
g++ -c -O3 -Wall -Wno-unknown-pragmas -Iinclude  -std=c++0x -fPIC -DDMLC_USE_HDFS=0 -DDMLC_USE_S3=0 -DDMLC_USE_AZURE=0 -msse2 -o line_split.o src/io/line_split.cc
g++ -c -O3 -Wall -Wno-unknown-pragmas -Iinclude  -std=c++0x -fPIC -DDMLC_USE_HDFS=0 -DDMLC_USE_S3=0 -DDMLC_USE_AZURE=0 -msse2 -o recordio_split.o src/io/recordio_split.cc
g++ -c -O3 -Wall -Wno-unknown-pragmas -Iinclude  -std=c++0x -fPIC -DDMLC_USE_HDFS=0 -DDMLC_USE_S3=0 -DDMLC_USE_AZURE=0 -msse2 -o input_split_base.o src/io/input_split_base.cc
g++ -c -O3 -Wall -Wno-unknown-pragmas -Iinclude  -std=c++0x -fPIC -DDMLC_USE_HDFS=0 -DDMLC_USE_S3=0 -DDMLC_USE_AZURE=0 -msse2 -o io.o src/io.cc
src/io/recordio_split.cc:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
src/io/input_split_base.cc:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
src/io.cc:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
src/io/line_split.cc:1:0: warning: -fPIC ignored for target (all code is position independent) [enabled by default]
src/io/input_split_base.cc: In member function 'void dmlc::io::InputSplitBase::InitInputFileInfo(const string&)':
src/io/input_split_base.cc:112:12: warning: variable 'exact_match' set but not used [-Wunused-but-set-variable]
In file included from c:\rtools\gcc-4.6.3\bin\../lib/gcc/i686-w64-mingw32/4.6.3/../../../../include/c++/4.6.3/cstdio:44:0,
                 from include/dmlc/io.h:8,
                 from src/io.cc:4:
c:\rtools\gcc-4.6.3\bin\../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64-mingw32/include/stdio.h:396:83: error: 'FILE* std::fopen(const char*, const char*)' should have been declared inside 'std'
c:\rtools\gcc-4.6.3\bin\../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64-mingw32/include/stdio.h:396:83: error: declaration of 'FILE* std::fopen(const char*, const char*)'
c:\rtools\gcc-4.6.3\bin\../lib/gcc/i686-w64-mingw32/4.6.3/../../../../i686-w64-mingw32/include/stdio.h:395:17: error: conflicts with previous declaration 'FILE* fopen(const char*, const char*)'
In file included from include/dmlc/./././parameter.h:25:0,
                 from include/dmlc/././registry.h:14,
                 from include/dmlc/./data.h:16,
                 from include/dmlc/threadediter.h:20,
                 from src/io/cached_input_split.h:16,
                 from src/io.cc:13:
include/dmlc/././././optional.h:31:27: error: both 'const' and 'constexpr' cannot be used here
In file included from include/dmlc/././registry.h:14:0,
                 from include/dmlc/./data.h:16,
                 from include/dmlc/threadediter.h:20,
                 from src/io/cached_input_split.h:16,
                 from src/io.cc:13:
include/dmlc/./././parameter.h: In member function 'virtual void dmlc::parameter::FieldEntry<float>::Set(void*, const string&) const':
include/dmlc/./././parameter.h:962:25: error: 'stof' is not a member of 'std'
include/dmlc/./././parameter.h: In member function 'virtual void dmlc::parameter::FieldEntry<double>::Set(void*, const string&) const':
include/dmlc/./././parameter.h:983:25: error: 'stod' is not a member of 'std'
In file included from src/io/cached_input_split.h:16:0,
                 from src/io.cc:13:
include/dmlc/threadediter.h: At global scope:
include/dmlc/threadediter.h:210:3: error: 'thread' in namespace 'std' does not name a type
include/dmlc/threadediter.h:216:3: error: 'mutex' in namespace 'std' does not name a type
include/dmlc/threadediter.h:222:3: error: 'condition_variable' in namespace 'std' does not name a type
include/dmlc/threadediter.h:224:3: error: 'condition_variable' in namespace 'std' does not name a type
include/dmlc/threadediter.h: In constructor 'dmlc::ThreadedIter<DType>::ThreadedIter(size_t)':
include/dmlc/threadediter.h:82:9: error: class 'dmlc::ThreadedIter<DType>' does not have any field named 'producer_thread_'
include/dmlc/threadediter.h: In member function 'virtual void dmlc::ThreadedIter<DType>::BeforeFirst()':
include/dmlc/threadediter.h:168:5: error: 'unique_lock' is not a member of 'std'
include/dmlc/threadediter.h:168:22: error: 'mutex' is not a member of 'std'
include/dmlc/threadediter.h:168:39: error: 'mutex_' was not declared in this scope

..... dmlc :: ThreadedIter :: Next()[with DType = dmlc :: data :: RowBlockContainer]'     src / data.cc:160:1:从这里实例化     include / dmlc / threadediter.h:387:5:错误:在此范围内未声明'lock'     include / dmlc / threadediter.h:在成员函数'bool dmlc :: ThreadedIter :: Next(DType **)[with DType = dmlc :: data :: RowBlockContainer]':     include / dmlc / threadediter.h:151:5:从'bool dmlc :: ThreadedIter :: Next()[与DType = dmlc :: data :: RowBlockContainer]实例化     src / data.cc:160:1:从这里实例化     include / dmlc / threadediter.h:362:3:错误:未在此范围内声明'lock'     include / dmlc / threadediter.h:在成员函数'void dmlc :: ThreadedIter :: Recycle(DType **)[with DType = dmlc :: data :: RowBlockContainer]'中:     include / dmlc / threadediter.h:149:7:从'bool dmlc :: ThreadedIter :: Next()[与DType = dmlc :: data :: RowBlockContainer]实例化     src / data.cc:160:1:从这里实例化     include / dmlc / threadediter.h:387:5:错误:在此范围内未声明'lock'     include / dmlc / threadediter.h:在成员函数'bool dmlc :: ThreadedIter :: Next(DType **)[with DType = dmlc :: data :: RowBlockContainer]':     include / dmlc / threadediter.h:151:5:从'bool dmlc :: ThreadedIter :: Next()[与DType = dmlc :: data :: RowBlockContainer]实例化     src / data.cc:160:1:从这里实例化     include / dmlc / threadediter.h:362:3:错误:未在此范围内声明'lock'     Makefile:83:目标'data.o'的配方失败     mingw32-make:*** [data.o]错误1

我google了很多,似乎在anacoda 3 windows 64上安装python xgboost的最新版本真的很难。 有没有人提示如何处理这个?

1 个答案:

答案 0 :(得分:4)

截至约一个月前,通过Conda可以获得x64版本的win64版本。 conda install py-xgboost应该有效。