Skip to content

Commit 8106c99

Browse files
committed
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.
1 parent e16d5f4 commit 8106c99

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

spin/cmds/meson.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,10 @@ def ipython(ctx, *, ipython_args, build=None, build_dir=None, pre_import=""):
766766
print(f'💻 Launching IPython with PYTHONPATH="{p}"')
767767
if pre_import:
768768
ipython_args = (f"--TerminalIPythonApp.exec_lines={pre_import}",) + ipython_args
769-
_run(["ipython", "--ignore-cwd"] + list(ipython_args), replace=True)
769+
_run(
770+
[sys.executable, "-P", "-m", "IPython", "--ignore-cwd"] + list(ipython_args),
771+
replace=True,
772+
)
770773

771774

772775
@click.command()

0 commit comments

Comments
 (0)