MCPcopy Index your code
hub / github.com/ipython/ipython / pip

Method pip

IPython/core/magics/packaging.py:93–107  ·  view source on GitHub ↗

Run the pip package manager within the current kernel. Usage: %pip install [pkgs]

(self, line)

Source from the content-addressed store, hash-verified

91
92 @line_magic
93 def pip(self, line):
94 """Run the pip package manager within the current kernel.
95
96 Usage:
97 %pip install [pkgs]
98 """
99 python = sys.executable
100 if sys.platform == "win32":
101 python = '"' + python + '"'
102 else:
103 python = shlex.quote(python)
104
105 self.shell.system(" ".join([python, "-m", "pip", line]))
106
107 print("Note: you may need to restart the kernel to use updated packages.")
108
109 def _run_command(self, cmd, line):
110 args = shlex.split(line)

Callers

nothing calls this directly

Calls 1

systemMethod · 0.80

Tested by

no test coverage detected