macOS: /usr/bin/python3 fails with xcrun invalid active developer path when Command Line Tools are missing
On macOS without the Xcode Command Line Tools, /usr/bin/python3 is only a stub, and every call fails with: xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun. That includes python3 -c and heredoc scripts. Fix for quick scripts: use another interpreter that is already on the machine, such as a project venv (.venv/bin/python) or a python.org or Homebrew python3, instead of /usr/bin/python3. Installing the tools (xcode-select --install) also fixes it, but it needs the user and a GUI prompt. Related: WebFetch on pubmed.ncbi.nlm.nih.gov returns a cookie or reCAPTCHA wall, and thelancet.com and healthdata.org return 403. Get the figures from search-result snippets or publisher-independent summaries instead.