Python 找不到 vcvarsall.bat

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17125561/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 00:32:00  来源:igfitidea点击:

unable to find vcvarsall.bat

pythonvisual-studio

提问by shimao

I know there's another question about it herealready, but I can't follow the answer. According to this answer, I just need to add a variable. However, i don't know where the variable is created and where it's located. Normally, I work with files and folders only, so i don't know how to get add a variable. Since i thought the variable might be inside the bat files, i looked in vcvarsall.bat, vsvars32.bat, and vsDevCmd.bat. In the latter two files, i found lines saying set VS110COMNTOOLS=, so on the line directly after i put @set VS90COMNTOOLS= C:\Program Files\Microsoft Visual Studio 11.0\Common7\Tools\ as the answer said. However, the same error occured. I tried to install Visual Studio 2010 as the answer is for 2010, but since i already have VS 2012 i wasn't able to.

我知道这里已经有另一个问题了,但我无法理解答案。根据这个答案,我只需要添加一个变量。但是,我不知道变量的创建位置和位置。通常,我只处理文件和文件夹,所以我不知道如何添加变量。由于我认为该变量可能在 bat 文件中,所以我查看了 vcvarsall.bat、vsvars32.bat 和 vsDevCmd.bat。在后两个文件中,我发现有几行说set VS110COMNTOOLS=, 所以在我把@set VS90COMNTOOLS= C:\Program Files\Microsoft Visual Studio 11.0\Common7\Tools\ 答案说出来之后直接就行了。然而,同样的错误发生了。我尝试安装 Visual Studio 2010 作为 2010 的答案,但由于我已经有了 VS 2012,我无法安装。

To summarize, where is exactly is the environment variable VS10COMNTOOLS=C:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools\ ? Thanks!

总而言之,环境变量到底在哪里VS10COMNTOOLS=C:\Program Files\Microsoft Visual Studio 10.0\Common7\Tools\ ?谢谢!

edit: sorry i confused VS 11 with 2011

编辑:抱歉,我将 VS 11 与 2011 混淆了

采纳答案by Peuczynski

Set the variable VS110COMNTOOLSto [...]Microsoft Visual Studio 11.0\Common7\Tools\

将变量设置VS110COMNTOOLS[...]Microsoft Visual Studio 11.0\Common7\Tools\

Had the same problem in some qt project while using vc compiler. You have to copy each missing file to [...]Microsoft Visual Studio 11.0\Common7\Tools\folder.

在使用 vc 编译器时在某些 qt 项目中遇到了同样的问题。您必须将每个丢失的文件复制到[...]Microsoft Visual Studio 11.0\Common7\Tools\文件夹中。

Just: - Read new error - copy the missing file located somewhere in [...]Microsoft Visual Studio 11.0\VC\folder

只是: - 读取新错误 - 复制位于[...]Microsoft Visual Studio 11.0\VC\文件夹中某处的丢失文件

till no errors

直到没有错误

EDIT: You used VS110, VS100and VS90in your case (VS2011) that would be VS110

编辑:您使用VS110VS100VS90在你的情况(VS2011),这将是VS110

回答by Droogans

What are you trying to import? Some modules don't play nicely on Windows -- best bet is to look at this repository of .exe files for Python packages for Windows.

你想导入什么?有些模块在 Windows 上不能很好地运行——最好的办法是查看这个.exe 文件库,用于 Windows 的 Python 包

Also, I've had the best luck by using all 32-bit versions of packages. I would recommend you do the same.

此外,我通过使用所有 32 位版本的软件包获得了最好的运气。我建议你也这样做。