diff --git a/IPython/core/magics/packaging.py b/IPython/core/magics/packaging.py index e20eb0c..60fe1ac 100644 --- a/IPython/core/magics/packaging.py +++ b/IPython/core/magics/packaging.py @@ -67,11 +67,10 @@ class PackagingMagics(Magics): %pip install [pkgs] """ python = sys.executable - if " " in python: - if sys.platform == "win32": - python = '"' + python + '"' - else: - python = shlex.quote(python) + if sys.platform == "win32": + python = '"' + python + '"' + else: + python = shlex.quote(python) self.shell.system(" ".join([python, "-m", "pip", line]))