Skip to content

[v640] Let embedded Python use the configured venv on macOS - #23623

Merged
guitargeek merged 2 commits into
root-project:v6-40-00-patchesfrom
guitargeek:pythonenv_bp640
Oct 6, 2026
Merged

guitargeek merged 2 commits into
root-project:v6-40-00-patchesfrom
guitargeek:pythonenv_bp640

Conversation

@guitargeek

@guitargeek guitargeek commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

This PR fixes the macos27 errors in the nightlies: https://github.com/root-project/root/actions/runs/37395144471/job/112049225240

Backport of #23622, plus a second commit that does the same for the TMVA SOFIE tests that are not present on master anymore.

On macOS, a Python interpreter that is embedded in a C++ process doesn't
use the virtual environment that the configured Python executable
belongs to, even if that environment is activated: CPython takes the
running binary as the executable and never finds the pyvenv.cfg of the
environment. On Linux, it finds `python3` in the PATH instead.

Therefore, C++ tutorials that embed Python, don't find Python modules
that are only installed in the virtual environment, even though CMake
found them with the Python executable of that environment and enabled
the tutorials.

Set PYTHONEXECUTABLE to the configured Python executable for the
tutorials on macOS, which makes the embedded interpreter use the same
environment.

(cherry picked from commit a3f3920)
Like 9ac24d5 but for the SOFIE tests that are only in ROOT 6.40.
@guitargeek guitargeek changed the title [v640][tmva][sofie] Let embedded Python use the configured venv on macOS [v640] Let embedded Python use the configured venv on macOS Oct 6, 2026
@dpiparo

dpiparo commented Oct 6, 2026

Copy link
Copy Markdown
Member

thanks, this will hopefully fix the residual failures!

@guitargeek
guitargeek merged commit ed6f641 into root-project:v6-40-00-patches Oct 6, 2026
34 of 35 checks passed
@guitargeek
guitargeek deleted the pythonenv_bp640 branch October 6, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants