Microsoft Visual C++ Compiler for Python 3.4

Python Programming

Question or problem about Python programming:

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.

How to solve the problem:

Solution 1:

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:

  • Visual Studio 2008 for Python 2.7.
    See: https://docs.python.org/2.7/using/windows.html#compiling-python-on-windows

  • Visual Studio 2010 for Python 3.4.
    See: https://docs.python.org/3.4/using/windows.html#compiling-python-on-windows

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

See: https://docs.python.org/2/install/#gnu-c-cygwin-MinGW or https://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.

Solution 2:

For the different python versions:

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

Also refer: this answer

Solution 3:

Visual Studio Community 2015 suffices 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

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

Hope this helps!