Issue when building scikit-learn in windows 7

2019-09-05 01:44发布

问题:

I've installed all dependencies for Scikit learn. But when I run

python setup.py build 

or

python setup.py install

commands I get the following error.

c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: build\temp
.win32-2.7\Release\sklearn\ensemble\_gradient_boosting.o: bad reloc address 0x0
in section `.data'
collect2.exe: error: ld returned 1 exit status
error: Command "g++ -shared build\temp.win32-.7\Release\sklearn\ensemble\_gradie
nt_boosting.o -LC:\Python27\libs LC:\Python27\PCbuild -Lbuild\temp.win32-2.7 -
lpython27 -lmsvcr90 -o build\lib.win32-2.7\sklearn\ensemble\_gradient_boosting.p
yd" failed with exit status 1

What is the reason for this? Is this a problem with latest development version(I'm using the latest master version from github repository). How do I solve this issue?

回答1:

Apparently you are not the only one having trouble building the master under windows.

However AFAIK none of the regular contributors to scikit-learn use windows as their primary development platform, so we would appreciate it if some windows expert could help us fix the build. I just opened an issue to track the build problem here:

https://github.com/scikit-learn/scikit-learn/issues/2174