...
Table of Contents | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
What is Jupyter and What is a Kernel?
Note |
---|
|
...
General Process
Info |
---|
The general process involves updating the conda environment to include kernel related packages, and then configuring the kernel spec to allow it to be picked up by the Jupyter service. |
...
Code Block |
---|
[]$ module purge []$ module load miniconda3/24.3.0 []$ conda activate /cluster/medbow/project/<project-name>/software/tensorflow/2.16 (/cluster/medbow/project/<project-name>/software/tensorflow/2.16) []$ export PYTHONUSERBASE=$CONDA_PREFIX (/cluster/medbow/project/<project-name>/software/tensorflow/2.16) []$ conda install ipykernel ... (/cluster/medbow/project/<project-name>/software/tensorflow/2.16) []$ python conda deactivate |
Created kernel related folder
Info |
---|
Installing the ipykernel package will create a kernel spec related folder that we can use. This can be found under the Conda environment location, under: |
Code Block |
---|
[]$ cd -m ipykernel install --user --name=TF2.16-local (/cluster/medbow/project/<project-name>/software/tensorflow/2.16) []$ cd share/jupyter/kernels/conda deactivate []$ ls python3 |
...
The Related Kernel Details
Info |
---|
Using the |
Code Block |
---|
() (/project/<project-name>/software/tensorflow/2.16) []$ lspython python3 kernel.json logo-32x32.png logo-64x64.png logo-svg.svg |
Info |
---|
Rename the folder to something more appropriate: |
Code Block |
---|
[]$ mv python3 TF2.16 |
Configure Your Jupyter Environment
Note |
---|
If you haven’t used the Jupyter service, then you might not have, and thus will need to create the following folders: ~-m ipykernel install --user --name=TF2.16-local Installed kernelspec TF2.16-local in /cluster/medbow/home/<username>/.local/share/jupyter/kernels/tf2.16-local |
Info |
---|
Copy the created |
Code Block |
---|
[]$ cp -r TF2.16/ ~ls /cluster/medbow/home/<username>/.local/share/jupyter/kernels/ |
Info |
---|
Update the
|
Code Block |
---|
[]$ ~tf2.16-local/ kernel.json logo-32x32.png logo-64x64.png logo-svg.svg []$ cat /cluster/medbow/home/<username>/.local/share/jupyter/kernels/TF2tf2.16/ []$ cat -local/kernel.json { "argv": [ "/cluster/medbow/project/<project-name>/software/tensorflow/2.16/bin/python", "-Xfrozen_modules=off", "-m", "ipykernel_launcher", "-f", "{connection_file}" ], "display_name": "TF2.16 (-local)", "language": "python", "metadata": { "debugger": true } } |
Info |
---|
Suggestion: Using “ |
Info |
---|
Side Note: Installing the Running |
Note |
---|
Kernel names can only contain ASCII letters and numbers and these separators: - . _ (hyphen, period, and underscore) Names can not use whitespace such as |
...
Start Jupyter
Info |
---|
From OnDemand start a Jupyter session. Notice how the newly configured kernel is now available. |
...