python要在Visual Studio 2015(v 14)中编译缺少vcvarsall.bat [英] vcvarsall.bat needed for python to compile missing from visual studio 2015 ( v 14)
问题描述
我正在尝试在装有Visual Studio 2015 Ultimate的Windows 10下的python 3.5中安装numpy.
I am trying to install numpy in python 3.5 under windows 10 with visual studio 2015 ultimate installed.
简短版本:vs14文件夹C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
文件夹中缺少文件vcvarsall.bat
.为什么?
Short version: file vcvarsall.bat
is missing from vs14 folder C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
folder. Why?
长版:
运行pip install numpy
会给我这个错误error: Unable to find vcvarsall.bat
Long version:
Running pip install numpy
gives me this error error: Unable to find vcvarsall.bat
研究此错误使我获得了几个stackoverflow答案,这些答案帮助我弄清楚python需要c ++编译器来编译某些软件包.并且它需要使用用于编译python 3.5的同一版本的编译器来执行此操作( 错误:找不到vcvarsall.bat ).我的python使用[MSC v.1900 64位(AMD64)]进行编译-vs 14(Visual Studio 2015)
researching this error got me to several stackoverflow answers that helped me figure out that python needs c++ compiler to compile some of the packages. And it needs the to do it using the same version of compiler that was used to compile python 3.5 ( error: Unable to find vcvarsall.bat ). My python is compiled using [MSC v.1900 64 bit (AMD64)] - which is vs 14 ( visual studio 2015 )
随着研究的深入,我从以下中学到了知识:
pip安装会导致错误:无法找到vcvarsall.bat 那
$python_install_prefix/Lib/distutils/msvc9compiler.py
中的get_build_version()
返回应用于查找vcvarsall.bat
路径的vs的版本
对我来说,此方法返回14.所以一切正确.
Moving further with my research i learned out from:
pip install gives error: Unable to find vcvarsall.bat that
get_build_version()
from $python_install_prefix/Lib/distutils/msvc9compiler.py
returns the version of vs that shoud be used to find the path of vcvarsall.bat
For me this method returns 14. So everything correct.
现在,当我查看文件夹C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
时,缺少vcvarsall.bat文件.
Now when I look into the folder C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
there file vcvarsall.bat is missing.
但是当我查看文件夹C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC
时,有一个vcvarsall.bat.
But when I look into the folder C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC
there is a vcvarsall.bat.
为什么vs 14.0中缺少vcvarsall.bat?
Why is vcvarsall.bat missing from vs 14.0 ??
推荐答案
确保在Visual Studio中安装了C ++通用工具.
Make sure C++ Common Tools are installed in Visual Studio.
程序和功能-> VS 2015->更改
Programs and Features -> VS 2015 -> Change
这篇关于python要在Visual Studio 2015(v 14)中编译缺少vcvarsall.bat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!