Search order (first verified hit wins):
getOption("templecbe.python")Sys.getenv("TEMPLECBE_PYTHON")Sys.getenv("RETICULATE_PYTHON")and, only when reticulate has already started Python in this session,reticulate::py_exe()Sys.which("python3"),Sys.which("python")Platform-specific well-known locations
Details
Each candidate is verified by actually running it, so Windows App Execution
Alias stubs (which resolve on PATH but do nothing) are rejected. A probe
that takes longer than 60 seconds (running --version, or importing
module) counts as a failure, so one hung interpreter cannot block the
search. When
verify = TRUE the candidate must additionally be able to
import module. Candidates are probed in a separate process:
this function never starts Python inside R, and never starts reticulate's
Python, so it is safe to use as a guard before code that would (for example
eval = !is.null(find_python(module = "numpy")) on a vignette chunk).
Install the pinned Python requirements for PDF conversion with
pip install -r on
system.file("python", "requirements.txt", package = "TempleCBE").
The tests that run a real PDF to DOCX conversion (Python, LibreOffice or
Word) are opt-in: set the environment variable
TEMPLECBE_RUN_PDF_TESTS=true to run them. See also
find_sas() for TEMPLECBE_RUN_SAS_TESTS.
