Skip to content

Commit

Permalink
Merge pull request #13055 from meeseeksmachine/auto-backport-of-pr-13…
Browse files Browse the repository at this point in the history
…052-on-7.x

Backport PR #13052 on branch 7.x (Fix path handling in `pip` line magic)
  • Loading branch information
MrMino committed Jul 13, 2021
2 parents 0f73966 + 912345e commit 4dcdce3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion IPython/core/magics/packaging.py
Expand Up @@ -65,7 +65,9 @@ def pip(self, line):
Usage:
%pip install [pkgs]
"""
self.shell.system(' '.join([sys.executable, '-m', 'pip', line]))
python = shlex.quote(sys.executable)
self.shell.system(" ".join([python, "-m", "pip", line]))

print("Note: you may need to restart the kernel to use updated packages.")

@line_magic
Expand Down

0 comments on commit 4dcdce3

Please sign in to comment.