Msys2: Maintaining two python installations

前端 未结 1 1005
挽巷
挽巷 2021-01-23 03:06

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 dea

相关标签:
1条回答
  • 2021-01-23 03:47

    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.

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