[英]Python distutils refuses to recognise installed C++ compilers, `Unable to find vcvarsall.bat` under Python 3.5
I'm tearing my hair out trying to compile c though Python's distutils. 我正在试图通过Python的distutils来编译c。 Specifically I'm trying to get started with Cython following this guide: http://docs.cython.org/src/quickstart/build.html , using a setup.py.
具体来说,我正在尝试按照本指南开始使用Cython: http ://docs.cython.org/src/quickstart/build.html,使用setup.py。
I'm running Python 3.5.0 under Anaconda 2.4.0 (64-bit), Windows 7. 我在Anaconda 2.4.0(64位),Windows 7下运行Python 3.5.0。
I get the Unable to find vcvarsall.bat
error referred to here: Cannot find vcvarsall.bat when running a Python script and in various other questions. 我找到了
Unable to find vcvarsall.bat
这里提到的Unable to find vcvarsall.bat
错误: 在运行Python脚本时遇到vcvarsall.bat以及其他各种问题。
None of the proposed solutions work for me . 所提出的解决方案都不适合我 。 So far I have tried:
到目前为止,我尝试过:
The only thing I can think of is installing MinGW which I've seen suggested in some places, but that CythonExtensionsOnWindows link specifically recommended against it. 我唯一能想到的是安装MinGW,我已经在一些地方看到了建议,但CythonExtensionsOnWindows链接专门建议反对它。
Any other suggestions would be very welcome! 任何其他建议将是非常受欢迎的! In particular, since I clearly have all the versions of VS I could possibly need, is there a way to force Python to recognise them, other than setting environment variables VS100COMNTOOLS or similar?
特别是,因为我清楚地拥有了我可能需要的VS的所有版本,除了设置环境变量VS100COMNTOOLS或类似之外,有没有办法强制Python识别它们?
Interestingly conda does seem to recognise the installed compilers, as a separate pip install attempt that failed with this same error, worked with conda. 有趣的是康达似乎以识别安装的编译器,作为一个单独的PIP安装尝试与此相同的错误失败,与康达合作。
As it turns out, Python 3.5 needs Visual Studio 2015. Advice elsewhere on fixing this for other Python versions is outdated. 事实证明,Python 3.5需要Visual Studio 2015.其他地方为其他Python版本修复此问题的建议已经过时。
Get Visual Studio 2015 Community here: https://www.visualstudio.com/en-us/downloads/visual-studio-2015-downloads-vs.aspx , this worked for me with no further steps needed. 在这里获取Visual Studio 2015社区: https : //www.visualstudio.com/en-us/downloads/visual-studio-2015-downloads-vs.aspx ,这对我有用,无需进一步的步骤。
Many thanks to Ionel, apparently the only place on the web to find this information! 非常感谢Ionel,显然是网上唯一能找到这些信息的地方! http://blog.ionelmc.ro/2014/12/21/compiling-python-extensions-on-windows/
http://blog.ionelmc.ro/2014/12/21/compiling-python-extensions-on-windows/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.