I have both versions of Python installed on my PC running Windows 10 and I can switch between them manually as needed, but I was wondering if there is a way to edit their path environment variables so that I can launch both of them from the CMD easily.
For example, instead of typing "python" to launch whatever is the default one right now, I want to just type python2 for one, and python3 for the other, is that possible?
Update: it turned out that you don't need any trick for this, you just use either py -2
or py -3
accordingly. Alternatively, you can configure your own aliases in cmd
as mentioned below.
python.exe
s and name thempython2.exe
andpython3.exe
. – Aran-Fey Jul 22 '16 at 17:47python.exe
topythonX.exe
, where X is whatever suffix you want, and then put both directories in your PATH. – Ross Ridge Jul 22 '16 at 17:47py -2
andpy -3
? – Valentin Lorentz Jul 22 '16 at 19:22