Python 使用最新版本的Visual Studio编译scikit learn

Python 使用最新版本的Visual Studio编译scikit learn,python,visual-studio,scikit-learn,cpython,Python,Visual Studio,Scikit Learn,Cpython,我有Windows和CPython版本3.6.1 我还安装了VisualStudio 2017,包括C++编译器 我试图通过发出以下命令来安装scikit learn pip install sklearn 但它失败了,出现以下错误: running build_clib No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils customize MSVCCompiler

我有Windows和CPython版本3.6.1

我还安装了VisualStudio 2017,包括C++编译器

我试图通过发出以下命令来安装scikit learn

pip install sklearn
但它失败了,出现以下错误:

running build_clib
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
customize MSVCCompiler
Missing compiler_cxx fix for MSVCCompiler
customize MSVCCompiler using build_clib
building 'libsvm-skl' library
compiling C sources
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

----------------------------------------
Command ""c:\program files\python36\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\raffa\\AppData\\Local\\Temp\\pip-build-gmj2ata7\\scikit-learn\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\raffa\AppData\Local\Temp\pip-leshnah_-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\raffa\AppData\Local\Temp\pip-build-gmj2ata7\scikit-learn\

它说它需要微软Visual C++ 14,它是VisualStudio 2015的一部分。但是我有2017年的版本,我不想仅仅为此安装另一个版本。有没有办法让SkEvin“识别”最近的Visual C++版本?C++标准总是相同的,或者至少向后兼容,所以我认为它也应该与最近的编译器

一起工作。
谢谢

为什么否决?我遇到了这个问题。我安装了VS2017的构建工具,但它不起作用。然后我将我的环境更改为Python3.5.2,问题就解决了。您可以尝试使用Python3.5.2作为您的环境。为什么要否决?我遇到了这个问题。我安装了VS2017的构建工具,但它不起作用。然后我将我的环境更改为Python3.5.2,问题就解决了。您可以尝试使用Python 3.5.2作为您的环境。