Skip to content

Commit

Permalink
Backport PR #13052: Fix path handling in pip line magic
Browse files Browse the repository at this point in the history
  • Loading branch information
madbird1304 authored and meeseeksmachine committed Jul 13, 2021
1 parent 0f73966 commit 912345e
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 912345e

Please sign in to comment.