|
|
|
## Installation von »Jupyter Notebook«
|
|
|
|
# Installation von »Jupyter Notebook« und »Jupyter Lab«
|
|
|
|
|
|
|
|
## Jupyter Notebook
|
|
|
|
|
|
|
|
»Jupyter Notebook« ist eine web-basierte interaktive Umgebung zur Erzeugung von
|
|
|
|
Jupyter-Notebook-Dokumenten (oft Python-Programme mit zugehöriger
|
| ... | ... | @@ -40,7 +42,7 @@ EOF |
|
|
|
|
|
|
|
### Systemd-Service-Datei zum Starten oder Stoppen des Servers
|
|
|
|
|
|
|
|
```systemd
|
|
|
|
```
|
|
|
|
cat <<EOF > /usr/lib/systemd/system/ipython-notebook.service
|
|
|
|
# README:
|
|
|
|
# Copy this file to /usr/lib/systemd/system/
|
| ... | ... | @@ -124,11 +126,67 @@ systemctl start ipython-notebook.service |
|
|
|
Der Serverzugriff entsprechend der hier gezeigten Installation erfolgt über
|
|
|
|
`http://HOSTNAME:82/`.
|
|
|
|
|
|
|
|
## Jupyter Lab
|
|
|
|
|
|
|
|
Die Installation von »Jupyter Lab« geschieht weitgehend in derselben Weise wie
|
|
|
|
»Jupyter Notebook«. In Folgenden werden nur die Unterschiede aufgeführt.
|
|
|
|
|
|
|
|
### Installation der nötigen Pakete
|
|
|
|
|
|
|
|
```
|
|
|
|
zypper in python3-pip
|
|
|
|
```
|
|
|
|
|
|
|
|
Sofern als Systempaket angeboten:
|
|
|
|
```
|
|
|
|
zypper in --recommends jupyter-jupyterlab
|
|
|
|
```
|
|
|
|
|
|
|
|
Im anderen Fall:
|
|
|
|
```
|
|
|
|
pip3 install jupyterlab
|
|
|
|
```
|
|
|
|
|
|
|
|
### Systemd-Service-Datei zum Starten oder Stoppen des Servers
|
|
|
|
|
|
|
|
```
|
|
|
|
cat <<EOF > /usr/lib/systemd/system/ipython-lab.service
|
|
|
|
# README:
|
|
|
|
# Copy this file to /usr/lib/systemd/system/
|
|
|
|
# sudo systemctl daemon-reload
|
|
|
|
# systemctl enable ipython-notebook
|
|
|
|
# systemctl start ipython-notebook
|
|
|
|
# The WorkingDirectory and ipython-dir must exist
|
|
|
|
# If you don't want anything fancy, go to http://127.0.0.1:8888 to see your notebook
|
|
|
|
# wheneber you want it
|
|
|
|
|
|
|
|
[Unit]
|
|
|
|
Description=IPython notebook
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=simple
|
|
|
|
PIDFile=/var/run/ipython-notebook.pid
|
|
|
|
ExecStart=/usr/bin/jupyter lab --notebook-dir=/home/ipynb/notebooks --no-browser --profile=nbserver --NotebookApp.allow_origin="http://127.0.0.1:82"
|
|
|
|
User=ipynb
|
|
|
|
Group=ipynb
|
|
|
|
WorkingDirectory=/home/ipynb/notebooks
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|
|
|
|
|
|
|
|
EOF
|
|
|
|
```
|
|
|
|
|
|
|
|
### Konfiguration
|
|
|
|
|
|
|
|
Das Folgende ist unter dem root-Account bzw. mit root-Rechten auszuführen:
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
systemctl enable ipython-lab.service
|
|
|
|
systemctl start ipython-lab.service
|
|
|
|
systemctl status ipython-lab.service
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
| ... | ... | |
| ... | ... | |