Installing Jupyter Notebook on OpenSuse Tumbleweed, and connecting via puTTY

These steps will get you set up installing Jupyter Labs on OpenSuse Tumbleweed, and then connecting remotely over SSH tunneling to the Jupyter installation from a Windows machine running puTTY.

Working assumption is that you have a fresh installation of Suse, and no cruft hanging around from previous installations .

Step one: Install python.

Assuming you’re in a regular shell and have access to sudo or doas.

sudo zypper install python311

Step two: create a virtual environment to run jupyter

user> mkdir ~/mydir
user> cd ~/mydir
user> python3 -m venv .

and activate the virtual environment,

user> source bin/activate
(mydir) user>

You can use deactivate to escape the virtual environment.

Step three: upgrade pip to the latest version

(mydir) user> pip install --upgrade pip

Step four: install Jupyter

(mydir) user> pip install jupyterlab

If you are running Suse on a workstation with a graphical interface, the at this stage you can run Jupyter and connect to it on the local box.

(mydir) user> jupyter-lab

and you should be able to open Jupyter locally by connecting to localhost:8888 in a browser session.

Step five: connecting remotely

However, if like me, your Suse box is sitting headless, whirring and collecting dust in an otherwise silent basement, then you’ll need to connect remotely via a tunnel. If you are using Windows and puTTY, then strike up puTTY in the usual way.

Add a new session, entering the IP address of your Suse box in the box beneath “Host Name (or IP address)”, and then give the session a name in the box beneath “Saved Sessions”

puTTY new session

In the left side panel, drill down to Connection > SSH > Tunnels. In the box beside “Source port” enter the port you intend to use. This is 8888 if you stay with the defaults. In the box beside “Destination” enter “localhost:8888”. If you elected to use a different port than the default, the port numbers should match. Finally click on Add.

puTTY ssh tunneling settings to Jupyter on port 8888

Important: next, in the left panel go back to the top and click on “Session” then click on the button marked “Save”. This will save the session for future use and prevent you having to go through the above rigmarole each time you want to connect.

Now, you can use the session details you just created to connect to your Suse box from your local puTTY client. Once connected, activate the virtual environment and start jupyter,

user> cd ~/mydir
user> source bin/activate
(mydir) user> jupyter-lab

Open a local browser and connect to localhost:8888 and you should see…

Jupyter log in page when connected

Back in the SSH terminal window, you will see details similar to

Jupyter lab server token for log in

You can cut and paste this token in to the login box and you should be in.

Jupyter Labs splash screen

1 Comment

Leave a Reply

Your email address will not be published.


*