How do you get the python version required for LLDB?

lldb -P usually prints something like this:

$ lldb -P
3.12.2 (main, Feb  6 2024, 20:19:44) [Clang 15.0.0 (clang-1500.1.0.2.5)]
/opt/homebrew/Cellar/llvm/17.0.6_1/libexec/python3.12/site-packages

But without a TTY, it only prints the path without the version. Is there a good way to check which version of python LLDB’s modules require from another program?

I am having some trouble getting versions to match up when LLDB in PATH may require a different version from the python3 in PATH. Debuginfo tests sometimes run with the wrong Python version on MacOS · Issue #123621 · rust-lang/rust · GitHub

in lldb, run these:
script import sys
script sys.version
script sys.path