python 需要 vcvarsall.bat 来编译 Visual Studio 2015 ( v 14 ) 中缺失的文件 [英] vcvarsall.bat needed for python to compile missing from visual studio 2015 ( v 14)

查看:17
本文介绍了python 需要 vcvarsall.bat 来编译 Visual Studio 2015 ( v 14 ) 中缺失的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在安装了 Visual Studio 2015 Ultimate 的 Windows 10 下的 python 3.5 中安装 numpy.

短版本:vs14 文件夹 C:Program Files (x86)Microsoft Visual Studio 14.0VC 文件夹中缺少文件 vcvarsall.bat.为什么?

长版:运行 pip install numpy 给我这个错误 error: Unable to find vcvarsall.bat

研究这个错误让我得到了几个stackoverflow的答案,这些答案帮助我弄清楚python需要c++编译器来编译一些包.它需要使用与编译 python 3.5 相同版本的编译器来完成(

I am trying to install numpy in python 3.5 under windows 10 with visual studio 2015 ultimate installed.

Short version: file vcvarsall.bat is missing from vs14 folder C:Program Files (x86)Microsoft Visual Studio 14.0VC folder. Why?

Long version: Running pip install numpy gives me this error error: Unable to find vcvarsall.bat

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 )

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.

Now when I look into the folder C:Program Files (x86)Microsoft Visual Studio 14.0VC there file vcvarsall.bat is missing.

But when I look into the folder C:Program Files (x86)Microsoft Visual Studio 12.0VC there is a vcvarsall.bat.

Why is vcvarsall.bat missing from vs 14.0 ??

解决方案

Make sure C++ Common Tools are installed in Visual Studio.

Programs and Features -> VS 2015 -> Change

这篇关于python 需要 vcvarsall.bat 来编译 Visual Studio 2015 ( v 14 ) 中缺失的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆