Tidying up Python

Bjarne D Mathiesen macintosh at mathiesen.info
Fri Jul 11 10:48:15 UTC 2025


Den 11.07.2025 kl. 11.51 skrev Ryan Carsten Schmidt:
>>> I believe I read somewhere that the python community recommends that "python" always be python 2.x, never python 3.x. Programs that want to use python 3.x should use the program name "python3". If "port select python" currently allows versions of python 3.x to be selected, we may want to change that.
>>
>> We did do a concerted effort in getting rid of python27 in macports some
>> time back. If I remember correctly, I had a major part in updating a lot
>> of stuff to at least python35 at that time.
>>
>> Python27 is offically dead. It was only being kept around in a comatose
>> state because of a lot of stuff not having been upgraded to python3.x
> 
> None of that contradicts what I wrote. Any program running "python" expects it to be python 2.x. Don't make "python" be python 3.x or you will break those programs. 
> 
> At least, that was the wisdom I gleaned last time I looked this up some years ago. If the position of the python community has changed since then, please provide a citation.

So, I used https://www.perplexity.ai/ with the following questions:

Q1 : what is the recommend default version of python on linux

The recommended default version of Python on Linux depends on the
specific distribution and its release cycle:

. Most modern Linux distributions are moving towards Python 3.12 or
newer as the default, with some rolling-release or cutting-edge
distributions (like openSUSE Tumbleweed) planning to adopt Python 3.13
as the primary interpreter soon [2]
. Ubuntu 22.04 LTS (a widely used stable release) ships with Python 3.10
by default, while older LTS versions have Python 3.8 or 3.5 [2][7]
. For maximum compatibility across distributions, Python 3.10 or 3.12 is
a safe baseline in 2025, but if you are starting new projects or using
the latest tools, Python 3.12 is broadly recommended [9]
. The absolute latest stable release is Python 3.13.3 as of June 2025,
and distributions that prioritize the newest features (like Fedora or
openSUSE Tumbleweed) are expected to adopt it soon [1][8]
. "Leap 15.5 and higher have also Python 3.11 and Tumbleweed have Python
3.11, 3.12, and ($DEITY willing) we will switch to 3.13 as the primary
interpreter." [2]

In summary, Python 3.12 is the recommended default for most Linux
distributions in 2025, with Python 3.13 becoming the new standard as
distributions update their repositories [1][2][9]. Always check your
specific distribution’s documentation for the current default and
compatibility considerations.

[1] https://www.liquidweb.com/blog/latest-python-version/
[2]
https://discuss.python.org/t/what-is-the-minimum-python3-version-i-can-expect-to-exist-on-most-linux-distributions/76927
[3]
https://www.reddit.com/r/learnpython/comments/1dodeie/which_version_of_python_should_i_download/
[4] https://devguide.python.org/versions/
[5]
https://pwskills.com/blog/python-vs-python3-which-one-you-should-go-with-in-2025/
[6] [removed]
[7]
https://discuss.avogadro.cc/t/lets-decide-on-a-python-version-policy-should-we-align-to-the-scientific-python-policy/6387
[8] https://www.python.org/downloads/
[9]
https://dev.to/onchana01/setting-up-a-professional-python-development-environment-in-2025-36j

Q2 : is python 2.7 recommended as the default python version

Python 2.7 is not recommended as the default Python version. Python 2.7
reached its official end-of-life on January 1, 2020, and no longer
receives security updates or bug fixes from the core Python development
team [7]. Most modern operating systems and distributions have
transitioned to Python 3 as the default, and major projects and
libraries have dropped support for Python 2.7 [8][5].

Continuing to use Python 2.7 as the default can lead to security
vulnerabilities and incompatibility with new software. If you need
Python 2.7 for legacy reasons, it is best to use it in isolated
environments (such as virtualenvs or containers) rather than setting it
as the system default [1][4]. For new projects and general use, always
use the latest stable release of Python 3.

[1]
https://stackoverflow.com/questions/19256127/two-versions-of-python-on-linux-how-to-make-2-7-the-default
[2]
https://stackoverflow.com/questions/63240182/python-versions-in-my-pc-shows-2-7-17-instead-of-3-8-5
[3]
https://stackoverflow.com/questions/56594702/how-can-i-fix-python-version-are-always-returned-2-7-instead-of-3-7/56595916
[4]
https://discuss.python.org/t/changing-default-version-of-python-from-2-7-16-to-3-12-1/42550
[5]
https://askubuntu.com/questions/1232996/my-default-python-version-is-2-7-18rc1-after-upgrade-from-18-04-to-20-04
[6]
https://www.reddit.com/r/linuxquestions/comments/e8fmvy/why_if_python_27_support_end_on_jan_1_2020_does/
[7] https://devguide.python.org/versions/
[8]
https://travis-ci.community/t/python2-7-has-been-replaced-with-3-7-by-default/4168/3
[9]
https://www.reddit.com/r/Python/comments/wvlnzf/where_is_python_2_still_used/
[10]
https://askubuntu.com/questions/1165360/why-is-python-2-7-still-the-default-python-version-in-ubuntu

-- 
Bjarne D Mathiesen
Slagelse ; Danmark ; Europa
-----------------------------------------------------------------------
denne besked er skrevet i et totalt M$-frit miljø
MacPro 2010 5.1 ; OpenCore + macOS 14.7.6 Sonoma
2 x 3,46 GHz 6-Core Intel Xeon ; 192 GB 1333 MHz DDR3 ECC RDIMM
ATI Radeon RX 590 8 GB



More information about the macports-users mailing list