1

I seek to be able to type something like

python36

or:

python35

in the command prompt to be be able to run 3.6 or 3.5 shells, respectively. When I type python in the command prompt, it only opens a 3.5 shell, and if I try to specify 3.6 by typing python3.6 or python3.5 or python36 or python35, it doesn't recognize the commands. For both installations, I checked the "Add to my path" box, and have since tried to manually add them to my path using system settings/advanced/environment variables, etc, but it's not clear to me how to best do this.

I am using Windows 7.

1
  • How you modify the system and user variables on Windows is well documented what step are you stuck on, edit your question, be specific
    – Ramhound
    Sep 13, 2017 at 21:37

1 Answer 1

5

Call py.exe instead of python:

  • py -3.6 will open a 3.6 shell;
  • py -3.5 will open a 3.5 shell;
  • py (check the version of an open shell: it could depend on installation and further settings).

Source: Python Launcher for Windows

New in version 3.3.

The Python launcher for Windows is a utility which aids in locating and executing of different Python versions. It allows scripts (or the command-line) to indicate a preference for a specific Python version, and will locate and execute that version.

Unlike the PATH variable, the launcher will correctly select the most appropriate version of Python. It will prefer per-user installations over system-wide ones, and orders by language version rather than using the most recently installed version.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .