2

I am using Msys2 portable under Win 10. I have 2 python 3.8 installations. The original question asked if that is so. I am now certain it is, so for the time being I want to deal with their maintenance.

I also posted another related question Msys2: readline in two python installations

I am posting below information on both.

My questions are:

  1. Can they interfere with each other? If so, what steps/configuration should I deal with? (PYTHONPATH, site-packages, etc.)

  2. Would it be safe removing any one of them, without breaking the other? Dependencies below seem to me this implies no risk, but I am not certain that is enough information to answer this.

  3. Which would be the best one to keep? I mean to use numpy, pandas, gcc-toolchain and debugger via Eclipse CDT, and a number of other packages.

PS1: This is in addition to python2, for which the same questions would apply.

PS2: It seems strange to me that the available subversions are not exactly the same, even if versions are both 3.8.2.

PS3: These two pythons are likely upgrades from the main characters of this "play", python 3.8 (3.8.1 before) upgraded to mingw-w64-x86_64-python 3.8.2-2 and python 3.7 upgraded to python 3.8.2-1.



Packages providing python
$ pacman -Sl | grep "python " | grep "installed"
mingw64 mingw-w64-x86_64-python 3.8.2-2 [installed]
msys python 3.8.2-1 [installed]

Additional info on each (dependencies, etc.)

$ pacman -Qi mingw-w64-x86_64-python
Name            : mingw-w64-x86_64-python
Version         : 3.8.2-2
Description     : A high-level scripting language (mingw-w64)
Architecture    : any
URL             : https://www.python.org/
Licenses        : PSF
Groups          : None
Provides        : mingw-w64-x86_64-python3=3.8.2
Depends On      : mingw-w64-x86_64-gcc-libs  mingw-w64-x86_64-expat  mingw-w64-x86_64-bzip2  mingw-w64-x86_64-libffi  mingw-w64-x86_64-mpdecimal
                  mingw-w64-x86_64-ncurses  mingw-w64-x86_64-openssl  mingw-w64-x86_64-sqlite3  mingw-w64-x86_64-tcl  mingw-w64-x86_64-tk  mingw-w64-x86_64-zlib
                  mingw-w64-x86_64-xz
Optional Deps   : None
Required By     : mingw-w64-x86_64-gdb  mingw-w64-x86_64-glib2  mingw-w64-x86_64-gtest  mingw-w64-x86_64-mono  mingw-w64-x86_64-postgresql
                  mingw-w64-x86_64-python-apipkg  mingw-w64-x86_64-python-appdirs  mingw-w64-x86_64-python-atomicwrites  mingw-w64-x86_64-python-attrs
                  mingw-w64-x86_64-python-cairo  mingw-w64-x86_64-python-colorama  mingw-w64-x86_64-python-contextlib2  mingw-w64-x86_64-python-cycler
                  mingw-w64-x86_64-python-defusedxml  mingw-w64-x86_64-python-imagesize  mingw-w64-x86_64-python-importlib-metadata  mingw-w64-x86_64-python-iniconfig
                  mingw-w64-x86_64-python-jdcal  mingw-w64-x86_64-python-kiwisolver  mingw-w64-x86_64-python-lxml  mingw-w64-x86_64-python-more-itertools
                  mingw-w64-x86_64-python-numpy  mingw-w64-x86_64-python-olefile  mingw-w64-x86_64-python-ordered-set  mingw-w64-x86_64-python-packaging
                  mingw-w64-x86_64-python-pathlib2  mingw-w64-x86_64-python-pillow  mingw-w64-x86_64-python-pluggy  mingw-w64-x86_64-python-py
                  mingw-w64-x86_64-python-pyparsing  mingw-w64-x86_64-python-pytest  mingw-w64-x86_64-python-pytz  mingw-w64-x86_64-python-scandir
                  mingw-w64-x86_64-python-seaborn  mingw-w64-x86_64-python-setuptools  mingw-w64-x86_64-python-sip  mingw-w64-x86_64-python-six
                  mingw-w64-x86_64-python-wcwidth  mingw-w64-x86_64-python-zipp  mingw-w64-x86_64-vapoursynth
Optional For    : mingw-w64-x86_64-vtk
Conflicts With  : mingw-w64-x86_64-python3  mingw-w64-x86_64-python2<2.7.16-7
Replaces        : mingw-w64-x86_64-python3
Installed Size  : 112.87 MiB
Packager        : Alexey Pavlov <alexpux@gmail.com>
Build Date      : Thu, Apr 9, 2020 10:17:39 AM
Install Date    : Wed, Apr 22, 2020 10:04:36 AM
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

$ pacman -Qi python
Name            : python
Version         : 3.8.2-1
Description     : Next generation of the python high-level scripting language
Architecture    : i686
URL             : https://www.python.org/
Licenses        : custom
Groups          : None
Provides        : python3
Depends On      : libbz2  libexpat  libffi  liblzma  ncurses  libopenssl  libreadline  mpdecimal  libsqlite  zlib
Optional Deps   : None
Required By     : gdb  python3-appdirs  python3-attrs  python3-pip  python3-pyparsing  python3-six  scons
Optional For    : None
Conflicts With  : None
Replaces        : python3
Installed Size  : 47.27 MiB
Packager        : Alexey Pavlov <alexpux@gmail.com>
Build Date      : Thu, Apr 16, 2020 12:31:48 PM
Install Date    : Wed, Apr 22, 2020 10:15:54 AM
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

Packages providing python2

$ pacman -Sl | grep "python2 " | grep "installed"
mingw64 mingw-w64-x86_64-python2 2.7.18-1 [installed: 2.7.17-2]
msys python2 2.7.18-1 [installed: 2.7.17-1]
  • You should settle on using one of them. Which one is better, I cannot say, it probably doesn't matter or it's a OS specific choice (I don't have experience with msys). Then you should make sure that `PYTHONPATH` doesn't point to the other installation. Actually you can just leave `PYTHONPATH` blank, unless you need to include some special search paths. For finding builtin modules it is not required. Regarding (2) it should be safe removing one without affecting the other. So the first step I'd suggest is choosing one of the two installations and removing the other, then check `PYTHONPATH`. – a_guest Apr 24 '20 at 11:59
  • @a_guest - Why do you say I should settle on using one of them? I understand it is easier, but I do not know of a reason why this shouldn't work. If you have a specific reason that makes this not workable, please let me know. – sancho.s ReinstateMonicaCellio Apr 24 '20 at 12:05
  • I don't have a specific reason, but I also happen to have zero experience with MSYS, so I don't know what it means to install each of those packages (i.e. what it actually changes behind the scenes). Maybe it adjusts the `PYTHONPATH` to its needs, copies some files, modifies the `PATH` etc. It's just trial and error, to see whether it's the packages that interfere with each other. So as long as you don't experience any errors, sure there's no problem in keeping both of them. – a_guest Apr 24 '20 at 12:12
  • @a_guest - The installations do not modify either `PATH` or `PYTHONPATH`, that I know. I can get the respective lists of provided files. And I am experiencing errors... – sancho.s ReinstateMonicaCellio Apr 24 '20 at 13:25
  • That's why I suggested to remove one of the packages. Then check if problems persist. If not, good. If you like to reinstall the package, at least you know what to focus on (i.e. whatever the installation performs interferes with the other Python). Without that little bit of experimentation I don't see a great chance of getting closer to a solution. – a_guest Apr 24 '20 at 13:34

1 Answers1

0

I use 2 Python different versions in MSYS2 shell (version 2 + 3).

What I do is the following:

  • Neither is of the Python paths is included in the PATH environment variable, so if something needs Python it fails.
  • When Python is needed I prepend PATH=<python_path>:$PATH to the command that needs it (e.g. PATH=/D/Prog/Python/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64:$PATH make) or if the command supports setting PYTHON in the environment I prepend PYTHON=<python_path>/python.exe before the command. In some cases where Makefile or configure accept a PYTHON variable it may also be possible to append PYTHON=<python_path>/python.exe after the command.
  • In case Python wants to load certain modules it may also be necessary to set the PYTHONPATH variable (e.g. PYTHONPATH=<python_path>/Lib/site-packages)

This works well for me and always forces me to choose which Python I use.

Brecht Sanders
  • 2,726
  • 1
  • 8
  • 18