Running Jupyter notebooks
Starting Sid
In all cases you need to start Sid
In the browser go to https://sid.hmdc.harvard.edu
Launch Sid
Click
Run An Interactive Application
Running Jupyter
The basic steps for Python, R or Julia notebooks are the same:
Select Jupyter
Select Version
Click Google drive (login if necessary)
Select CPU/RAM
Click
Launch Application
Wait until URL is visible. The status will change from
Initializing
toRunning
.Click on the URL
You can now create a Jupyter notebook.
Click on the New
button on the top right and select Julia, Python or R.
Video tutorial of these steps:
At this moment you notebooks are saves on ephemeral storage. This means that when the container is deleted all the files will be lost. Store your files on Google Drive to save your work.
Accessing Google Drive
If you selected Google Drive as your storage provider when running a Jupyter notebook on Sid, the google-drive
folder will be available in the default location as a subfolder of Jupyter's home directory. You should see the google-drive
immediately upon accessing your job via the Sid-produced job url.
Installing Python libraries
Some libraries are already installed in the Python notebooks of Jupyter. ggplot2
or pandas
for example. Other libraries will need to be installed manually.
Open a new terminal
New>Terminal
run this to install libraries
For example iflxml
is not installed, you will get an error like this.
In this case you need to install lxml using:
Video tutorial of these steps:
Creating a script for installing Python libraries
Just as files on the ephemeral storage will be lost after deleting the container, so will the libraries need to be reinstalled for every container. To make things easier you can write a file that you can run to install the libraries you need.
This is a different way than explained in the video tutorial. Working with requirements.txt
is a more standard way of doing this.
Creating the script
Choose
New>Text File
In text file write the names of the libraries you want to install. Write one library on each line.
Choose
File>Save
and save the file as:requirements.txt.
Make sure it is saved on Google Drive
Close the Tab
Running the script
Open a terminal from Jupyter:
New > Terminal
cd
into the directory where you saved the filerun the command the following command to install all the libraries:
Video tutorial of these steps:
Using and installing R Libraries
Installing R libraries in Jupyter is easy. Using libraries you add the library command in the notebook cells:
If a library is not available and get an error like this. In this case the `dslabs` library is missing:
Install the package from within your notebook with:
Last updated
Was this helpful?