Skip to content

Commit

Permalink
Merge pull request #203 from MAAP-Project/refine_kernel_installation
Browse files Browse the repository at this point in the history
Refine jupyter notebook kernel installation doc
  • Loading branch information
emileten authored May 23, 2023
2 parents 242770c + d0c2e47 commit 7340394
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions docs/source/system_reference_guide/custom-environments.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,16 @@
"\n",
"### Using custom environments in jupyter notebooks\n",
"\n",
"To make your environment accessible in a Jupyter notebook, you need to register a kernel that has your environment. You can use the `ipykernel install` command for this, which means you must list `ipykernel` as a dependency in your configuration file. An example is in `env3.yml`, that creates an environment named `env3`. After creating it, you run the kernel registration command this way :\n",
"\n",
"```\n",
"python -m ipykernel install --user --name env3 --display-name \"Python env3\"\n",
"```\n",
"\n",
"Once this is done, wait around 30 seconds for the registration to propagate. Then, click on a new launcher button. Among the notebook options, you should see \"Python env3\". This will spin up a notebook with your environment. Below you can find a screenshot showing the commands on the notebook : \n",
"\n",
"The following instruction steps are for python kernels.\n",
"\n",
"- Make sure ipykernel is listed as a dependency in your configuration file. An example that has such a dependency is env3.yml\n",
"- Create your environment using that configuration file\n",
"- Install the environment as a kernel by running the following command (parameter values follow the example mentioned):\n",
" ```\n",
" python -m ipykernel install --user --name custom_env_name --display-name \"Python env3\".\n",
" ```\n",
" The above command installs the environment as a kernel in Jupyter, making it accessible in the notebook with a display name of \"Python env3\".\n",
"- Wait around 30 seconds and launch a new notebook. Among the kernel options, you should see \"Python env3\" listed. Below you can see a screenshot that shows what this step looks like:\n",
"![Register a kernel with a conda environment and launch a notebook with it](../_static/launch_registered_kernel_custom_conda.png)\n",
"\n",
"### Suggested packages for custom environment\n",
Expand All @@ -139,7 +141,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "base",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand All @@ -153,12 +155,17 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.9"
"version": "3.10.10"
},
"metadata": {
"interpreter": {
"hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6"
}
},
"vscode": {
"interpreter": {
"hash": "8a5edab282632443219e051e4ade2d1d5bbc671c781051bf1437897cbdfea0f1"
}
}
},
"nbformat": 4,
Expand Down

0 comments on commit 7340394

Please sign in to comment.