Run the uv package manager within the current kernel. Usage: %uv pip install [pkgs]
(self, line)
| 165 | |
| 166 | @line_magic |
| 167 | def uv(self, line): |
| 168 | """Run the uv package manager within the current kernel. |
| 169 | |
| 170 | Usage: |
| 171 | %uv pip install [pkgs] |
| 172 | """ |
| 173 | python = sys.executable |
| 174 | if sys.platform == "win32": |
| 175 | python = '"' + python + '"' |
| 176 | else: |
| 177 | python = shlex.quote(python) |
| 178 | |
| 179 | self.shell.system(" ".join([python, "-m", "uv", line])) |
| 180 | |
| 181 | print("Note: you may need to restart the kernel to use updated packages.") |