From a44718bdb19469bee2674ef8a01353b97554b025 2021-08-15 22:14:56 From: Artur Svistunov <18216480+madbird1304@users.noreply.github.com> Date: 2021-08-15 22:14:56 Subject: [PATCH] Fix for https://github.com/ipython/ipython/issues/13084 --- diff --git a/IPython/core/magics/packaging.py b/IPython/core/magics/packaging.py index f1b1954..48b4b36 100644 --- a/IPython/core/magics/packaging.py +++ b/IPython/core/magics/packaging.py @@ -12,7 +12,7 @@ import re import shlex import sys from pathlib import Path - +from multiprocessing import list2cmdline from IPython.core.magic import Magics, magics_class, line_magic @@ -66,8 +66,7 @@ class PackagingMagics(Magics): Usage: %pip install [pkgs] """ - python = shlex.quote(sys.executable) - self.shell.system(" ".join([python, "-m", "pip", line])) + self.shell.system(list2cmdline([sys.executable, "-m", "pip"]) + " " + line) print("Note: you may need to restart the kernel to use updated packages.")