Running Jupyter notebooks
Last updated
Was this helpful?
Last updated
Was this helpful?
In all cases you need to start Sid
In the browser go to
Launch Sid
Click Run An Interactive Application
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
to Running
.
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.
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.
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:
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.
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
Open a terminal from Jupyter: New > Terminal
cd
into the directory where you saved the file
run the command the following command to install all the libraries:
Video tutorial of these steps:
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: