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. 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. 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:)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |