
If you require two versions, then reconfigure your $PATH variable so the 'default' version you want is in front or if you are using most Linux distros, the command you are looking for is sudo update-alternatives.
#GSWITCH MACOS MANUAL#
You can use your OS's standard package/program install/uninstall/management facilities to help track things down, and perhaps (unless you are doing dev work that surprisingly is impacted by the few backwards-incompatible changes between minor versions) delete the old version (or do make uninstall if you did a manual installation). 3.1 vs 3.2, and you are confused that you have somehow installed two versions of python, this is possibly because you have done manual and/or manual installations.

In the extremely unlikely case that if someone comes to this question with two python3 versions e.g. This will only work on your local computer (as it should), and is somewhat unnecessary compared to just typing it out (unless you invoke the command constantly).Ĭonfused users should not try to create aliases or virtual environments or similar that make python execute python3 this is poor form.This is acceptable nowadays, but PEP 394 suggests encouraging users to use a virtualenv instead. The way you do so depends on the shell, but perhaps you could do alias py=python3, and put it in your shell startup file. You could, however, make a custom alias in your shell. Otherwise as an end user, you should feel free to rename this for your own personal use (though your OS or distribution may not make that easy). It was last updated in June 2019.īasically if you are writing a library, you should specify the version of python (2 or 3, or finer-grained under specific circumstances) you can use. The prescription for how distributions should handle the python command was written up in 2011 as PEP 394 - The "python" Command on Unix-Like Systems. This has for example (python-is-python3-package) freed up the python command to be settable to a user default, but it really depends on the operating system. For example, they might call #!/usr/bin/env python2 or #!/usr/bin/env python3.
#GSWITCH MACOS SOFTWARE#
Nowadays, many years after the python2->python3 transition, most software explicitly refers to python2 or python3 (at least on Linux). Extremely old systems may have programs and scripts which expect python=python2, and changing this would break those programs and scripts.Īt the time this answer was written, OP should not have changed this due to maintaining compatibility for old scripts. At the time, programs invoking ' python' were expecting python2 (which was the main version at the time). This happened due to a need for backwards compatibility.Įven though technically python doesn't even guarantee backwards compatibility between minor versions, Python3 really breaks backwards compatibility.

The naming convention is that generally, most scripts will call python2 or python3 explicitly.

#GSWITCH MACOS HOW TO#
If you are confused about how to start the latest version of python, on most platforms it is the case that python3 leaves your python2 installation intact (due to the above compatibility reasons) thus you can start python3 with the python3 command. (Regardless if you are on Mac, Linux, or Windows:)
