аватар question@mail.ru · 01.01.1970 03:00

Change the Python version in Windows 10

Actually, I have in the system (Win 10) 2 versions of Python, both are needed. How can you switch them? In the situation on the screen, why does the version write 2.7, and starts 3.8? I read what I need to change something in the Path system variables, but what exactly, I didn’t find sensible information.

аватар answer@mail.ru · 01.01.1970 03:00

The py utility is a launcher that, using the command line keys, allows you to run the desired version of Python (from installed on this computer). Help on this utility:

  c: \ users \ user & gt; py --helppython launcher for windows 3.1115013usage: py [launcher-urgs] [python-args] script [script-args] launcher arguments: -2: launch The latert Python 2.x Version-3: Launch The Latest Python 3.x Versiona-X.y :y :y :y :y :y :y :y :y: Launch The Specified Python Version the ABOVE All Default to 64 Bit if A Matching 64 Bit Python Is-x.y-32: Launch The Specified 32bit Python Version-X-32: Launch The Latest 32bit Python X Version-X.y-64: Launch The Specified 64BITHON VERSONION-X-64: LAUNCH The LATIST 64BIT PYTHON X Version-0 --List: List the Availble Pythons-0P --List-Paths: List with Paths    

i.e., if you need to run Python 2.7, you need to indicate the py in the command line -2.7 or py -2 (then the Python interpreter will be launched by the newest version from the "branch" 2 of the installed).

Also, this utility can take a version of the Python from the line of the script: if at the beginning of the script to write #! Python2.7 , and starting the script using the
py name_cript.py
, the script will be launched using the Python version 2.7 (or another version that you indicate).

see. Also:

  • Documentation:

Latest

Similar