"\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m24.0\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m25.1.1\u001b[0m\n",
"\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpython -m pip install --upgrade pip\u001b[0m\n"
]
}
],
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"if [ -z \"${VIRTUAL_ENV}\" ]; then\n",
" echo \"ERROR: Virtual environment not successfully initialized.\"\n",
<h5 style="text-align: right">Author: <a href="mailto:j.goebbert@fz-juelich.de?subject=Jupyter-JSC%20documentation">Jens Henrik Göbbert</a></h5>
<h5><ahref="../index.ipynb">Index</a></h5>
<h1style="text-align: center">Create your own Jupyter Kernel with pyenv</h1>
%% Cell type:markdown id: tags:
Often the standard kernel do not provide all features you need for your work. This might be that certain modules are not loaded or packages are not installed.
With your own kernel you can overcome that problem easily and define your own environment, in which you work.
This notebook shows you how you can build your own kernel for a **pyenv environment**.
<divclass="alert alert-block alert-info">
<b>Attention:</b></br>
pyenv is a wonderful tool for managing multiple Python versions.</br>
You can easily try out new language features or help contribute to a project that is on a different version of Python.</br>
Using pyenv is also a great way to install pre-release versions of Python so that you can test them for bugs.</br>
</br>
<b>BUT</b>, if this is not your intention and you are fine with the default Python version of your current software stage.</br>
<b>DO NOT use pyenv</b> - please have a look at the general (PyPI) howto called "Create_JupyterKernel_general.ipynb" instead.</br>
</div>
<divclass="alert alert-block alert-info">
<b>Attention:</b>
This notebook is meant to run out of a JupyterLab on JSC's HPC systems.</br>
</div>
--------------------------------------
%% Cell type:markdown id: tags:
## Building your own Jupyter kernel is a four step process
1. Install pyenv
* run the pyenv installation
1. Create/Pimp new virtual Python environment
* venv
2. Create/Edit launch script for the Jupyter kernel