From 688ef553689381260aece17aab390ec19e286d6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Salda=C3=B1a?= Date: Sat, 17 Aug 2024 19:46:39 -0500 Subject: [PATCH] Add DevContainer setup for Python and Jupyter kernel support --- docs/jupyter-in-polyglot-notebooks.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/jupyter-in-polyglot-notebooks.md b/docs/jupyter-in-polyglot-notebooks.md index c6a69143ba..e11b6f68fb 100644 --- a/docs/jupyter-in-polyglot-notebooks.md +++ b/docs/jupyter-in-polyglot-notebooks.md @@ -101,4 +101,20 @@ Or, you can get similar experience by adding `condaenvpython3.9` as a kernel spe ``` #!connect jupyter --kernel-name pythonkernel --conda-env base --kernel-spec condaenvpython3.9 -``` \ No newline at end of file +``` + +## Using DevContainers + +The default Python3 configuration does not include the kernel, so you need to modify the devcontainer.json file to use a Dockerfile: + +``` +FROM mcr.microsoft.com/devcontainers/dotnet:1-8.0 + +RUN apt update +RUN apt install -y python3 python3-pip python3-ipykernel +``` + +After loading the DevContainer, run the following command in a cell: +``` +#!connect jupyter --kernel-name pythonkernel --conda-env base --kernel-spec python3 +```