How to setup Jupyter notebook for the in-person Linux lab.
The following instructions are for setting up Jupyter on the CSS In-Person Linux lab.
$
clear-cache && PROMPT_DIRTRIM=1 ### Replace /data/shared/netid-projectdir/ for actual directory name ### $ mkdir -p /data/shared/netid-projectdir && cd /data/shared/netid-projectdir
Install virtualenv and Jupyter Notebook on the project directory.
### Confirm you are inside the project directory ### $ pwd ### /data/shared/netid-projectdir ### $ pip3 install virtualenv $virtualenv netid-JPnotebook && source
### The following commands take some time to install, allow it to run to completion ###netid-JPnotebook
/bin/activate $ pip install --upgrade pip$ pip install ipykernel $ pip install notebook
### You have now successfully installed Jupyter Notebook ###
Run Jupyter Notebook
$ jupyter notebook
When running the “$ jupyter notebook” command, please allow a few seconds to load.
A new browser window should open with the Jupyter notebook.
If the browser doesn’t open automatically, you can also copy URL from the terminal.
To stop Jupyter notebook use the “Quit” button on the top right corner.
To exit the Jupyter virtualenv:
$ deactivate
Activating virtualenv on a new SSH session.
After closing your SSH session, the virtualenv will deactivate. In order to start the environment again you will need to navigate to your project directory, e.g. /data/shared/netid-projectdir , and run the following command.
$ source netid-JPnotebook
/bin/activate
How to setup Jupyter Notebook for the CSS Remote Linux lab.
Login to any CSS Remote Linux Lab. For this example we will be using machine 5.
$ ssh Your-UWNetid@csslab5.uwb.edu ### Name your project-dir anything you would like. e.g. netid-project1 ### $ mkdir -p ~/project-dir && cd ~/project-dir
Install virtualenv and Jupyter Notebook on the project directory.
### Confirm you are inside the project directory ### $ pwd ### /home/NETID/Your-netid/project-dir ### $ pip3 install virtualenv $virtualenv netid-JPnotebook && source
### The following commands take some time to install, allow it to run to completion ###netid-JPnotebook
/bin/activate $ pip install --upgrade pip$ pip install ipykernel $ pip install notebook
### You have now successfully installed Jupyter Notebook ###
Because the Jupyter server is running on a remote system you will need to open a second terminal and create a tunnel. When login in, it will look like the terminal is hanging, this is normal and you need to leave the session open.
### Second SSH terminal ### $ ssh -NL 1234:localhost:1234 Your-UWNetid@csslab5.uwb.edu ### The session looks like is hanging but this is normal, you can minimize the SSH terminal ###
Start Jupyter Notebook on Remote Linux Lab.
Return to your Main SSH terminal and start the Jupyter Notebook.
$ jupyter notebook --no-browser --port 1234
To access the notebook, copy and paste the URLs at the bottom of the screen. Example:
Paste the URL on your web browser to open the remote Jupyter notebook.
Possible errors:
If you notice that the port 1234 changes to 1235. e.g.
That means the port 1234 is already in use. You will need to create a new tunnel with port 1235 instead.
### Second SSH Terminal ### $ ssh -NL 1235:localhost:1235 Your-UWNetid@csslab5.uwb.edu ### Main SSH Terminal ### $ jupyter notebook --no-browser --port 1234
[Errno 122] Disk quota exceeded: ‘/home/NETID/$USER/.cache/pip/’
Check your home folder to see what is taking up the space using these commands:
$ cd ~ $ du -h --max-depth=1 | grep '[100-900]M\>'
Remove any directory/files that are no longer necessary. Sometimes old virtual env are taking space.
For example:
$ rm -rf ./jupyter-env $ clear-cache