Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which Python should I install (and how) when using msys2?

While the current official Python version is 3.6, msys2 provides two packages for python3:

  • msys/python3, currently using 3.4
  • mingw64/mingw-w64-x86_64-python3, currently using 3.5

So which version should I use when and how? Can't I just use the Windows 3.6 and somehow tell pacman to use that? Or can I get 3.6 running in a msys/mingw'd version and also use that in Windows so I don't need two/three installations?

like image 595
Tobias Kienzler Avatar asked Aug 26 '26 22:08

Tobias Kienzler


1 Answers

It can be confusing why there are two versions of Python, but both serve different use cases:

  1. MINGW - Windows native applications
  2. MSYS2 - POSIX applications emulated to work in Windows

MINGW refers to executables that are compiled using the MINGW GCC Compiler and target the Win32 API. MSYS2 refers to executables that are compiled by MSYS2 GCC Compiler and make use of a POSIX emulation layer.

I understand as a user this can be confusing, why do you care which compiler and API Python is compiled against? Well some programs you may want to make use of, are dependent on running in a POSIX environment. It would be very hard and time consuming to port these applications to Windows. In these cases, MSYS2 provides an emulation layer to allow these applications to work. Unfortunately, making use of this emulation layer is very very slow.

So in general, if you can use the MINGW version of Python, you should because it will be much faster. But if you are trying to run a Python application that depends on being in a POSIX environment, then MSYS2 provides an emulation layer to help make it work.

For more information, the Git for Windows Wiki provides a more detailed explanation.

like image 96
Dan Yeaw Avatar answered Aug 29 '26 13:08

Dan Yeaw



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!