How to install Jupyter notebook on Mac M1?

Answered by Phillip Nicastro

Installing Jupyter Notebook on a Mac M1 requires a few steps. I will guide you through the process step by step, providing detailed instructions for each step. Let’s get started!

Step 1: Install Xcode
To begin, you need to install Xcode, which is Apple’s integrated development environment. Xcode provides the necessary tools and libraries for building software on macOS. You can download Xcode from the Mac App Store or Apple’s developer website. Once downloaded, follow the installation instructions provided by Apple.

Step 2: Install the Command Line Tools Package
After installing Xcode, you need to install the Command Line Tools Package, which includes essential command line utilities and development headers. Open Terminal, which you can find in the Utilities folder within your Applications folder, and run the following command:
Xcode-select –install
This command will prompt you to install the Command Line Tools Package. Follow the on-screen instructions to complete the installation.

Step 3: Install Miniforge
Next, we’ll install Miniforge, which is a lightweight distribution of the Conda package manager. Conda makes it easy to manage packages and environments for scientific computing. Open Terminal and run the following commands:
The first command downloads the Miniforge installer, and the second command runs the installer. Follow the prompts to complete the installation. When asked for the installation location, you can choose the default option or specify a different directory if desired.

Step 4: Create a Conda environment and install TensorFlow
After installing Miniforge, we’ll create a Conda environment and install TensorFlow within that environment. Open Terminal and run the following commands:
Conda create -n myenv python=3.9
Conda activate myenv
Pip install tensorflow
The first command creates a new Conda environment named “myenv” with Python version 3.9. You can choose a different name if you prefer. The second command activates the newly created environment. the third command installs TensorFlow using pip within the environment.

Step 5: Install Jupyter Notebooks
Now that you have TensorFlow installed, you can proceed to install Jupyter Notebooks. Open Terminal and run the following command:
Pip install jupyter
This command will install Jupyter Notebooks within your Conda environment.

Step 6: Installing Common Additional Packages
Lastly, you may want to install some additional packages commonly used with Jupyter Notebooks. Open Terminal and run the following commands to install popular packages such as NumPy, Pandas, and Matplotlib:
Pip install numpy pandas matplotlib
Feel free to install any other packages you may need for your specific use case.

That’s it! You have successfully installed Jupyter Notebook on your Mac M1. You can now launch Jupyter Notebooks by running the following command in Terminal:
Jupyter notebook
This will open Jupyter in your web browser, where you can create and manage notebooks.

I hope this detailed guide helps you install Jupyter Notebook on your Mac M1. If you encounter any issues or need further assistance, please feel free to ask!