GLib2 tries to find "python3" and if it can't find it, it will go for "python"; if port select wasn't explicitly run, this will likely end-up with Python 2.7. As a fallback, meson can use whatever python it's running on if the argument to find_installation is empty. --- meson.build.orig 2022-10-25 20:53:22.000000000 +0800 +++ meson.build 2022-10-27 06:00:59.000000000 +0800 @@ -2279,9 +2279,9 @@ glib_conf.set('HAVE_PROC_SELF_CMDLINE', have_proc_self_cmdline) -python = import('python').find_installation() +python = import('python').find_installation('') # used for '#!/usr/bin/env ' -python_name = 'python3' +python_name = '@PYTHON@' python_version = python.language_version() python_version_req = '>=3.5'