From 8106c9966eb286e62c7d3756399bc50bf881c7d5 Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Mon, 5 Jan 2026 17:54:01 -0800 Subject: [PATCH] Launch IPython directly from package, instead of from path It happens, sometimes, that an install from a different version of Python is on the path. That leads to some unexepected and hard to debug issues. --- spin/cmds/meson.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spin/cmds/meson.py b/spin/cmds/meson.py index cf4848d..a9a6cd5 100644 --- a/spin/cmds/meson.py +++ b/spin/cmds/meson.py @@ -766,7 +766,10 @@ def ipython(ctx, *, ipython_args, build=None, build_dir=None, pre_import=""): print(f'💻 Launching IPython with PYTHONPATH="{p}"') if pre_import: ipython_args = (f"--TerminalIPythonApp.exec_lines={pre_import}",) + ipython_args - _run(["ipython", "--ignore-cwd"] + list(ipython_args), replace=True) + _run( + [sys.executable, "-P", "-m", "IPython", "--ignore-cwd"] + list(ipython_args), + replace=True, + ) @click.command()