1

I'm a Windows user. I used to install the official CPython from python.org. But recently I tried the mingw-w64-x86_64-python offered by MSYS2.

The two interpreters show different banners at launch:

  • python.org: Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)] on win32
  • MSYS2: Python 3.8.3 (default, Jun 17 2020, 06:11:06) [GCC 10.1.0 64 bit (AMD64)] on win32

This tells that they are built by different compilers.

My Questions

  1. What's the main differences between the two implementation from a user's point of view, especially those relating to package installation?
  2. With the GCC version, I can install packages using either pacman or pip (I used pacman to install pip since pip was not included by default), which one should I use for package installation? In fact, pip failed when I tried to install packages like numpy, pandas and jupyter, pacman could install them but I don't know if there are any compatibility issues.
KamilCuk
  • 120,984
  • 8
  • 59
  • 111
271828
  • 27
  • 4
  • You tagged `pacman` which is an old arcade game. `either pacman or pip` Am I not aware of something, but `pacman` is a package manager on archlinux linux distribution, which is not windows. Is there another `pacman`? – KamilCuk Jun 26 '20 at 13:27
  • @KamilCuk: I haven't used Unix or Linux. What I know it that MSYS2 is like a Unix emlulator for Windows, which makes a lot of Unix commands like `touch`, `ls` availble on WIndows. With MSYS2 installed, I can use `pacman` to install packages on Windows as well. – 271828 Jun 26 '20 at 13:33
  • Thank you, MSYS2 uses a port of archlinux package manager. Sure. – KamilCuk Jun 26 '20 at 13:39

2 Answers2

1

The world is vast. Someone produces things, someone else distributes them. You can buy Michelin tires from Michelin, from an Audi reseller or from your local car repair shop. (Maybe tires is not a great analogy, but let me stick to it.)

The "producer" here is Python Software Foundation. The foundation "produces" python source code. Now you can "buy" source code directly from the producer - download source code from their site and compile it yourself. You might go to one of the globally available distributors - like pip that is a generic tool for python to distribute package. Or you may go to one of your local shops in the area that sells python - like specific for your certain environment package manager pacman.

What's the difference between Python built by MSC and Python built by GCC?

They were packaged by different organizations and it seems compiled using different compilers.

What's the main differences between the two implementation from a user's point of view, especially those relating to package installation?

None. If you use Michelin tires, there is no difference where you bought them. Or there can be slight differences in the product, which maybe relevant to you and you may favor one shop over the other. And other shop will give you a refund for your purchase - ie. you will use a different tool to uninstall and manage the software.

which one should I use for package installation?

This is an opinion based question. Use that one that suits your needs. I guess not all possible python packages are packaged by MSYS2 team (not all possible tires are available at your local car shop), so I use pip when possible.

KamilCuk
  • 120,984
  • 8
  • 59
  • 111
  • I prefered `pip` because its a larger shop and I believe larger means better compatibility. But like @Serge Ballesta suggested, if the package is not pure python and uses some c/c++ function, there maybe a problem. Indeed, when I tryed to install `numpy` with `pip`, it failed and reported something like `don't know how to compile blablabla... on mingw64`. – 271828 Jun 26 '20 at 14:52
  • I think Serge Ballesta is right: if the package is written pure python, then there should not be any difference since the top level abstraction is the python interpreter. As long as the interpreter is built according to python standards, there should not be difference for pure python code. But if the package relies on some no python code, then there may be implementation defined nuances. – 271828 Jun 26 '20 at 14:52
0

From a user point of view, and if you used only plain python modules, there should be no difference at all. The main difference is that their non-Python modules (using C or C++ code) are not compatible. You can install both on the same machine, but each one will require its own set of libraries, and you will have to know which one you want to invoke.

Unless you intend to use binary modules which would exist only for one architecture, I would suggest to use only one to avoid future problems.

Serge Ballesta
  • 143,923
  • 11
  • 122
  • 252
  • I don't know why but Python is included when I installed the `gcc-toolchain`. I think I can just leave the gcc-python alone and just use the old one as usual. But, if someday, I do want to use that gcc-python, should I install packages using only pacman? – 271828 Jun 26 '20 at 13:42
  • @271828: I do not know about `pacman` and only use `pip`. But with both version installed, I would care to have them in different places, make sure to know which one is used, and for that reason I would consistently use `/path/to/python -m pip` to make sure to use the correct pip version. – Serge Ballesta Jun 26 '20 at 14:12