Jupyter notebooks and jupyter labs are preferred workbenches for many data science projects. For IoT projects, it’s always not possible to connect to the Raspberry PI desktop to access the notebooks. We can access Raspberry PI via console using SSH but for some applications especially for the Computer Vision, we still need some graphical user interface.
In this article, I wish to share some of the techniques I found to run the Jupyterlab on a raspberry PI and access it from a remote machine.
Connect to your Raspberry PI using SSH. Install all the dependencies. We will use pip3 to install jupyter lab later.
$ sudo apt-get update
$ sudo apt-get install python3-pip
$ sudo pip3 install setuptools
$ sudo apt install libffi-dev
$ sudo pip3 install cffi
Install jupyter using pip3. If you are using virtualenv then follow the instructions from the jupyter documentation here.
$ pip3 install jupyterlab
Create a directory for your notebooks and start jupyter lab (optional)
$ mkdir notebooks
$ jupyter lab --notebook-dir=~/notebooks
Alternately you can also start the jupyterlab from any directory as below.
$ jupyter lab
This should will start the jupyterlab running on https://localhost:8888 on raspberry pi but its not accessible from the your local machine. Also once you close your SSH session, the jupyterlab instance will be terminated.
To resolve this issue, we need to start the jupyterlab as a service.
#computer-vision #data-science