Skip to content

Installing and Using Jupyter

Installing Jupyter

Installing Jupyter is very easy. You can follow the instructions below, or visit the Installation Page on the Jupyter website.

Open your Terminal, and run the following code:

pip install notebook

That's it! To run a jupyter notebook, simply run this code in your terminal: jupyter notebook

This will open a web browser running Jupyter. You will see a filepath from the working directory where you were located when you ran the notebook command.

You can also download and use JupyterLab if you prefer, which works more like a native app instead of in a tab of your web browser.

What is an interactive environment?

Code is just a string of characters and numbers. In order for it to produce the output that the user intends, it must be read by a computer and compiled. Originally, computers used a command-line interface (CLI), which requires strings of code in a computer language as input, which are then executed. This is one of the most challenging things to adjust to for new coders who are used to a graphical user interface, also known as a 'GUI'. Instead of pushing buttons in a visual program, like an app, the user has to know text commands that will tell the computer to do what they want.

Creating files and programs using a computer language is different from how many of us first learned how to make things on a computer. Unlike writing a document in Microsfot Word, or creating a slide in Microsoft Powerpoint, the creation of a code document (written in a given computer language) and its final output are decoupled. Programs like Microsoft Office, and many others you are probably familiar with on your own computer, are often referred to as "what you see is what you get" (WYSIWYG) - meaning the visual representation as you work on the document directly reflects how it will look in its final form - and this is how a vast majority of users first learn how to use a computer.

By contrast if you have ever tried markdown, LaTex, or even HTML/CSS you may be familiar with the concept of writing strings of code that the computer then formats for you. In order to make changes, you can't simply place your cursor on the formatted document and type - you have to go back to the source code and make the changes these, then re-compile the document. This can be incredibly tedious, especially if compilation is slow, or your are relying on multiple programs to run the code, compile it, and display the output.

There are pros and cons to both approaches of asking a computer to generate output. Interactive environments help bridge the gap between them. When working with computer languages such as Python and R, we don't have the option of using a WYSIWYG program, because they don't exist! Instead, we can use an interactive environment, which combines a traditional text editor (for writing code) with other windows that can do things like compile code and display output. This allows you to edit code and see the output almost instantaneously, much like you were using a WYSIWYG program.

Why do I need Jupyter?

Jupyter is a web-based interactive environment for coding and creating shareable computational documents. It is compatible with many different programming languages, making it versatile. It is also web-based, making it more flexible than a native app. However, the best thing about Jupyter, by far, is the ability to save documents with both the code and output of that code and share it with others. If you learn to use Jupyter Notebooks, you will always have an environment you are comfortable coding in, and a way to save and visualize your work no matter what computer language you are working in (unless it is incredibly specific - more on that later).

There are other programs that make sense to explore, especially if you are interested in writing your own programs. VScode and Sublime are two popular programs used for this purpose.