Tidying up Python
Bjarne D Mathiesen
macintosh at mathiesen.info
Fri Jul 11 08:52:15 UTC 2025
regarding having more than one python version installed:
What often happens is, that you have a port, that needs python, like eg
this:
#=> port info certbot
certbot @4.1.1 (security)
Variants: docs, python310, python311, python312, [+]python313, python39
As you can see, the default is currently python313, !but! if you
installed certbot, when python312 was the default, it doesn't
automagically get updated to python313 .
Thus, when a new major version of python gets released, you'll have to
manually check which ports are dependent on the old major version, and
see, if they have been updated to the latest major version.
In my case, I'm still having python311 around because
#=> port dependents python311 | grep -v py311-
docker-compose depends on python311
#=> port info docker-compose
docker-compose @1.29.2_1 (python, devel)
Build Dependencies: py311-build, py311-installer, py311-setuptools,
py311-wheel
Library Dependencies: py311-distro, py311-docker, py311-dockerpty,
py311-docopt, py311-jsonschema, py311-python-dotenv, py311-requests,
py311-six, py311-socks, py311-texttable, py311-websocket-client,
py311-yaml, python311
When checking for dependency on a previous version of python, I do this:
#=> port dependents python311 | grep -v py311
Then, I explicitly upgrade the python variant like this:
port -cuN upgrade --enforce-variants certbot -python312 +python313
--
Bjarne D Mathiesen
Slagelse ; Danmark ; Europa
-----------------------------------------------------------------------
denne besked er skrevet i et totalt M$-frit miljø
MacPro 2010 5.1 ; OpenCore + macOS 14.7.4 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