How to fire up a Jupyter Notebook on Mac

Jupyter Notebook is a scripting and prototyping application, combining code and rich text elements to create human-readable analysis descriptions alongside any results you generate with your code. Notebook documents are also executable, and can be run (and re-run) to perform data analysis. For a more in-depth overview, check out this entry in readthedocs.io.

Jupyter in Action

Getting started

To start, let’s open Terminal which can be found in your Applications ► Utilities.

Before installing the Jupyter package, it is always a good idea to upgrade pip. We’ll do that with the following commands.

pip install --upgrade pip
pip install --upgrade ipython jupyter

Next create a directory wherever you would like to store your project, and change directory to it.

mkdir folder_name
cd folder_name

Now we can start up our Jupyter Notebook and start coding!

jupyter notebook
Jupyter Notebook Start Screen
Jupyter Notebook Startup Page

Create a New Jupyter Notebook

Now all you need to do is create a new Python 3 Notebook. We will do that by clicking: New ► Python 3

Create a new Python 3 Jupyter Notebook
Click New ► Python 3

You’re all set. Start scripting and away!

Optional Setup

Packages

Recommend installing Pandas for your data processing, and NumPy for your linear algebra needs.

pip install pandas
pip install numpy

Virtual Environments

I find it’s generally much cleaner and a best practice to spin up Virtual Environments for each of my Python projects. To learn how to create a new Python Virtual Environment, and how to connect it to your notebook, checkout this article on using Python Virtual Environments in Jupyter Notebook.

Show 1 Comment

1 Comment

Comments are closed