If you’re looking to accelerate your career into data science and machine learning, then you need the right tools for the job.
Julia, Python, and R are three of the essential programming languages for working with data.
Combining the three, Jupyter Notebook was born.
Jupyter offers a fast and efficient notebook environment to its users. Unfortunately, it’s not so straightforward to installing Jupyter notebook on a mac notebook.
This guide will provide a foolproof method of installing Jupyter notebook on your Mac.
What Is A Jupyter Notebook?
Jupyter is a programmer’s notebook containing both codes and images, hyperlinks, or other “Rich text elements.” A Jupyter notebook may also have tables and cells for importing code and live data analysis.
Although Julia, Python, and R were the first languages that Jupyter notebook was built to support (and named after), new versions offer support for multiple programming languages. T
Installing Jupyter notebook is often done using packages from package managers. The method differs depending on whether you’re using Windows or OS X.
In either case, you’ll need to have python has been pre-installed on the machine.
If you need to install python, make sure you check for the latest version on the Python website. The website has full instructions to download and install python 3, as well as new releases.
You can also install Python using Anaconda, which will provide a rich environment on your notebook with prebuilt packages distributed. Anaconda is available for download on the official Anaconda website – both new and old distributions of Anaconda are available.
Complete installation instructions for Anaconda and additional packages are available to download on the Anaconda website as well.
For Windows users, installing a new instance of Jupyter is simple.
First, check to make sure you have python installed on your machine and ready to use. Check if Python is installed on your machine in three simple steps:
Open a new instance of PowerShell. You can also use the anaconda terminal to run python 3 (or any other version).
Once the terminal has started running, type the following command:
$ python --version
If successful, PowerShell will echo with the python version printed on the terminal. If you see an error, either you do not have python installed, or python has not yet been added to the path.
Make sure you have the latest Python 3 version for the best Jupyter notebook coding environment.
Once you have your python environment ready, you can use either the pip or the conda packet manager to install Jupyter on your machine. Other packages exist, but these are the most straightforward to use for new user installation.
Install using conda
The first option is using conda. Conda is an open-source, cross-platform package manager which comes pre-packaged with Anaconda’s packages. The conda package manager will provide you the command to install the Jupyter notebook for you.
On the command line, type:
$ conda install -c conda-forge jupyterlab
If successful, the Jupyter notebook will be installed on your machine and ready to use. You can now start Jupyter notebook using any of the following commands:
$ py -m notebook $ python -m notebook $ jupyter notebook
Install Using Pip
The other most popular package manager is Pip. Pip comes pre-packaged with the latest version of Python 3.
Check to see if you have the latest python version installed as before.
Verify Pip Version
You can see your pip version from the command line using:
$ pip --version
Once you have pip ready, make sure you have Pip added to your PATH environment variable in your library.
Now, run the following command on the terminal to start Jupyter:
$ pip install jupyterlab
This will successfully download once you click install. After the installation has finished, launch JupyterLab with:
Once you start Jupyter, you’re all set to create new notebooks, start a project, and create a coding environment of your choice.
If you’re not sure where to start, head over to Jupyter’s website for official documentation.
For Mac users getting started with Jupyter, creating notebooks may seem complicated – but it’s not.
As with the Windows installation, you’ll need a package manager so that you can install both Python 3 and Jupyter. Python 3 is required as the latest notebooks are not optimized for older python versions.
Instead of anaconda, we will install Jupyter Notebook using Homebrew for Mac OS.
Step 1: Install XCode Command Line Tools
First, install XCode command-line tools:
Open zshell and type:
$ xcode-select --install
Step 2: Verify Installation and Environment Path
Verify your xCode installation by typing:
$ xcode-select -p
If the shell echos an environment path to “CommaldLineTools,” it means you can now install and open python. If not, you need to install Xcode again.
Step 3: Install Homebrew
Copy the following command on your shell and execute:
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Step 4: Install Python
Now run the following command:
$ pyenv install 3.x.x
This will install the latest python version. You will require Python version 3.x.x to utilize the latest Jupyter Notebook updates.
Step 5: Install Jupyter
Complete your Jupyter installation using:
$ brew install jupyter
Step 6: Verify Your Jupyter Installation
You can verify if Jupyter has been installed correctly using the following command:
$ jupyter notebook
You can create more than one Jupyter notebook and save them with code. Make sure to test some live code after installing Jupyter.
Many notebooks are available for programming today, but none are as widespread and versatile as the Jupyter Notebook.
Whether you’re a PC or a Mac user, you’ll require a package manager for running Jupyter. Homebrew manager on Mac helps you to install Jupyter Notebook in six simple steps.
Download xTools and Python on your Mac today, and you’ll learn to document professional-level notebooks in no time!