...
Install individual Python
...
kernel
Jupyter allows you to work in with your own virtual environment using condaenvironment. You can use e.g. conda for this task. Start by creating a new conda environment:
Codeblock |
---|
module purge ##just in case you are using jupyter terminal
module load Miniconda/3.1
conda create -p /gpfs/project/$USER/py310 python=3.10
conda activate /gpfs/project/$USER/py310 |
...
Codeblock |
---|
cd /gpfs/project/$USER/py310
vi kernel.sh
|
Contents of the file kernel.sh:
Codeblock |
---|
---------------------------------------------------- #!/bin/bash export PYTHONHOMEPYTHONPATH=/gpfs/project/$USER/py310/lib/python3.10/site-packages export PATH=/gpfs/project/$USER/py310/bin:$PATH exec python -m ipykernel $@ ---------------------------------------------------- |
Make the file executable with
chmod a+x kernel.sh
Create a new directory for your kernel in your /home/.local/share folder
...
Codeblock |
---|
{ "argv": [ "/gpfs/project/$USER/py310/kernel.sh", "-f", "{connection_file}" ], "display_name": "VenvPython 3.10 (py310conda)", "language": "python", "metadata": { "debugger": true } } |
In your next jupyterhub session a new kernel with the name "venv (py310Python 3.10 (conda)" will then be available.
...