Jupyter User Guide
Table of contents
- How to add python packages to Jupyter
- Via virtual environments
- Via miniconda
- How to update the python version
- How to use R in Jupyter
How to add python packages to Jupyter
Via virtual environments
- Open a terminal and type:
python3 -m venv <myEnv>
- Activate your environment:
source <myEnv>/bin/activate
- Install your packages:
pip install -U pip
pip install <mypackage>
- Install the ipykernel package:
pip install ipykernel
- Register your virtual environment as custom kernel to Jupyter:
python3 -m ipykernel install --user --name=<myKernel>
Via miniconda
- Load the miniconda module by clicking first on the blue hexagon icon on the left-hand side of Jupyter's start page and then on the "load" Button right of the entry for miniconda in the software module menu:
- Open a terminal and type:
conda create --name <myenv>
- Activate your environment:
conda activate <myenv>
- Install your packages:
conda install <mypackage>
- Install the ipykernel package:
conda install ipykernel
- Register your virtual environment as custom kernel to Jupyter:
python3 -m ipykernel install --user --name=<myKernel>
How to update the python version
- Activate the Miniconda module as shown in the previous section.
- Create a virtual environment with a custom python version via conda:
conda create --name <myenv> python=<python version>
- Install the ipykernel package:
conda install ipykernel
- Register your virtual environment as custom kernel to Jupyter:
python3 -m ipykernel install --user --name=<myKernel>
- Select your newly created kernel in Jupyter
How to use R in Jupyter
- On the cluster:
$ module load math/R
$ R
> install.packages('IRkernel')
- On bwVisu:
- Start Jupyter App
- In left menu: load math/R
- Open Console:
$ R
> IRkernel::installspec(displayname = 'R 4.2')
- Start kernel 'R 4.2' as console or notebook