Skip to content

Commit 1713846

Browse files
authored
Launch IPython directly from package, instead of from path (#307)
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 cf300ca commit 1713846

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
@@ -765,7 +765,10 @@ def ipython(ctx, *, ipython_args, build=None, build_dir=None, pre_import=""):
765765
print(f'💻 Launching IPython with PYTHONPATH="{p}"')
766766
if pre_import:
767767
ipython_args = (f"--TerminalIPythonApp.exec_lines={pre_import}",) + ipython_args
768-
_run(["ipython", "--ignore-cwd"] + list(ipython_args), replace=True)
768+
_run(
769+
[sys.executable, "-P", "-m", "IPython", "--ignore-cwd"] + list(ipython_args),
770+
replace=True,
771+
)
769772

770773

771774
@click.command()

0 commit comments

Comments
 (0)