适用于 Python 3.4 的 Microsoft Visual C++ 编译器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29909330/
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 05:09:40  来源:igfitidea点击:

Microsoft Visual C++ Compiler for Python 3.4

pythonwindowspython-3.xcompilation

提问by Rusty Weber

I know that there is a "Microsoft Visual C++ Compiler for Python 2.7"but is there, currently or planned, a Microsoft Visual C++ Compiler for Python 3.4 or eve Microsoft Visual C++ Compiler for Python 3.x for that matter? It would be supremely beneficial if I didn't have to install a different version of visual studio on my entire lab.

我知道有一个“适用于 Python 2.7 的 Microsoft Visual C++ 编译器”,但目前或计划中是否有适用于 Python 3.4 的 Microsoft Visual C++ 编译器或适用于 Python 3.x 的 Microsoft Visual C++ 编译器?如果我不必在我的整个实验室中安装不同版本的 Visual Studio,那将是非常有益的。

采纳答案by Vivian De Smedt

Unfortunately to be able to use the extension modules provided by others you'll be forced to use the official compiler to compile Python. These are:

不幸的是,为了能够使用其他人提供的扩展模块,您将不得不使用官方编译器来编译 Python。这些是:

Alternatively, you can use MinGw to compile extensions in a way that won't depend on others.

或者,您可以使用 MinGw 以不依赖其他方式编译扩展。

See: https://docs.python.org/2/install/#gnu-c-cygwin-MinGWor https://docs.python.org/3.4/install/#gnu-c-cygwin-mingw

请参阅:https: //docs.python.org/2/install/#gnu-c-cygwin-MinGWhttps://docs.python.org/3.4/install/#gnu-c-cygwin-mingw

This allows you to have one compiler to build your extensions for both versions of Python, Python 2.x and Python 3.x.

这允许您使用一个编译器为 Python 的两个版本、Python 2.x 和 Python 3.x 构建扩展。

回答by Colonel Panic

Visual Studio Community 2015suffices to build extensions for Python 3.5. It's free but a 6 GB download (overkill). On my computer it installed vcvarsall at C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat

Visual Studio Community 2015足以为 Python 3.5 构建扩展。它是免费的,但需要 6 GB 的下载(过大)。在我的电脑上它安装了 vcvarsall C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat

For Python 3.4 you'd need Visual Studio 2010. I don't think there's any free edition. See https://matthew-brett.github.io/pydagogue/python_msvc.html

对于 Python 3.4,您需要 Visual Studio 2010。我认为没有任何免费版本。见https://matthew-brett.github.io/pydagogue/python_msvc.html

回答by Ani Menon

For the different python versions:

对于不同的python版本:

Visual C++ |CPython
--------------------
14.0       |3.5
10.0       |3.3, 3.4
9.0        |2.6, 2.7, 3.0, 3.1, 3.2

Source: Windows Compilers for py

来源:py 的 Windows 编译器

Also refer: this answer

另请参阅:此答案