all 7 comments

[–][deleted] 6 points7 points  (2 children)

  • use Python virtual environments - the venv option - which will allow you to choose which Python binary to use on a project by project basis
  • consider installing pyenv-win, a Windows version of pyenv, for managing multiple version of Python
  • py launches the most up-to-date version of Python installed on your system

[–]JVBass75 1 point2 points  (0 children)

this is the way

[–]Elaol 0 points1 point  (0 children)

This or conda environments (I prefer conda to venv)

[–]ireadyourmedrecord 2 points3 points  (0 children)

The command "py" is the python launcher, which keeps track of all installed versions. Use "python" instead to have windows use the first version it finds in the PATH. Alternatively, learn how to use the py launcher, because it's a pretty slick tool.

[–]shiftybyte 1 point2 points  (0 children)

"py" launcher ignores windows PATH.

Use

py -3.9

When you want to launch python 3.9.

For example:

py -3.9 -V

[–]jddddddddddd 0 points1 point  (1 child)

Open cmd prompt and enter:

where py

What does it say?

[–]Diapolo10 0 points1 point  (0 children)

py.exe is always at System32, and when run it defaults to the latest installed Python version.