Microsoft Visual C++ Compiler for Python 3.4

后端 未结 3 2023
我在风中等你
我在风中等你 2020-11-29 18:24

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 V

相关标签:
3条回答
  • 2020-11-29 18:48

    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

    0 讨论(0)
  • 2020-11-29 18:52

    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

    0 讨论(0)
  • 2020-11-29 18:58

    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.

    0 讨论(0)
提交回复
热议问题