I recently tried to uninstall Python 3.5.2 and installed Python 3.6.0. I used to use python in the command line to run Python 3.5.2 from the command line, and py to run Python 2.7.12. Now, python runs Python 3.5.2, and py runs Python 3.6.0. I am running Windows 10, and python3, python2, py2, and py3 do not do anything.
1 Answer 1
Don't bother adding Python to the path. Just use:
py Run highest version of Python (override with PY_PTYHON environment variable).
py -2 Run highest version of Python 2.
py -3 Run highest verssion of Python 3.
py -2.7 Run Python 2.7.
py -2.7-32 Run python 2.7 32-bit when on a 64-bit system.
More: https://docs.python.org/3.6/using/windows.html#python-launcher-for-windows
Note you can also specify in scripts which version to use as well with, for example:
#!python2
#!python3
#!python2.7
1 Comment
#!python and #!/usr/bin/python, the new version of the launcher still maps "python" to Python 2 for the sake of Unix compatibility.Explore related questions
See similar questions with these tags.
py -2. To make this the default, set the environment variablePY_PYTHON=2.