Jupyter Notebook

Personally, I like jupyter notebook a lot, since it offers plenty of useful tools to work on your code. Specifically, it enables you to test your code on the run by providing multiple cells which can be used to run specific parts of the code. In case, there are errors in some parts of the code, then you don’t need to rerun the whole code but only the part you have errors. Moreover, it offers a convenient way to visualize your code, to inspect the variables.

Installation

For conda users following command is good to go:

conda install -c conda-forge notebook

For old-school pip:

pip install notebook

Usage

In order to launch the notebook:

jupyter notebook

If you are interested in using jupyter notebook through a specific port (8888 for instance):

jupyter notebook --port 8888

If everything goes smooth, after running the command, the main browser should open a tab for your notebooks. On the other hand, if it doesn’t happen, you can just copy and paste the link printed in the command line.

Remote

If you want to access the notebooks in a remote machine, you need to forward everything on port 8888 (the port you use for jupyter-notebook) of the server (in 127.0.0.1:8888) to the local machine on port 1234 (again this can be any port). This can be done by connecting to a server with a small addition to the original ssh command.

ssh -L 1234:127.0.0.1:8888 acc_name@server_ip

Here, the “-L” option allows you to map a specific port on the server machine to your local machine’s port.

Then you will be able to connect the jupyter-notebook of interest through the following link(http://127.0.0.1:1234) from your local device.

Congratulations, you can enjoy your notebook.