当我尝试构建一个包时:
C:\Linter\intlib\PYTHON>python setup.py build
我收到此错误消息:
running build
running build_ext
building 'LinPy' extension
error: Unable to find vcvarsall.bat
这是我的 Python 版本:
Python 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 20:20:57) [MSC v.1600 64 bit (AMD64)] on win32
我在 Windows 10 x64 上工作。我知道 this线程和其他几十个(如 this 和 this 等等)。所以,我想我几乎尝试了一切,但没有任何效果。似乎所有这些线程都已过时,所以我需要一些新收据。顺便提一句。我试过这个:
SET VS90COMNTOOLS=%VS100COMNTOOLS%
还有这个(在 Visual Studio 2015 Visual Studio 命令提示符中):
set DISTUTILS_USE_SDK=1
我在我的机器上到处寻找 vcvarsall.bat
,但找不到。
我调查了这个文件夹 C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools
,但它不包含任何 .bat
文件。无论如何,在我进行了所有操作之后 python setup.py build
仍然会引发完全相同的错误。所以,我需要帮助。谢谢!
最佳答案
这个问题是因为您没有为您尝试运行的接受构建安装编译器。
根据 MS Python 工程社区,以下是您可能需要的内容,
Python Version |You will need
------------------------------------
3.5 and later |Visual C++ Build Tools 2015 or Visual Studio 2015
3.3 and 3.4 |Windows SDK for Windows 7 and .NET 4.0
|(Alternatively, Visual Studio 2010 if you have access to it)
2.6 to 3.2 |Microsoft Visual C++ Compiler for Python 2.7
您需要安装:Windows SDK for Windows 7 and .NET 4.0或 VS 2010
来源:How to deal with the pain of “unable to find vcvarsall.bat”
关于python - Windows 10 和无法找到 vcvarsall.bat,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37534000/