Skip to content

Commit 4dcdce3

Browse files
authored
Merge pull request #13055 from meeseeksmachine/auto-backport-of-pr-13052-on-7.x
Backport PR #13052 on branch 7.x (Fix path handling in `pip` line magic)
2 parents 0f73966 + 912345e commit 4dcdce3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

IPython/core/magics/packaging.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ def pip(self, line):
6565
Usage:
6666
%pip install [pkgs]
6767
"""
68-
self.shell.system(' '.join([sys.executable, '-m', 'pip', line]))
68+
python = shlex.quote(sys.executable)
69+
self.shell.system(" ".join([python, "-m", "pip", line]))
70+
6971
print("Note: you may need to restart the kernel to use updated packages.")
7072

7173
@line_magic

0 commit comments

Comments
 (0)