How To Run Jupyter Notebook , Pandas And Numpy On M1 MacBook ?

 Last month apple came with their own m1 chips with arm architecture. Till current date only Jupyter Notebook is supported by the m1 chip but you don't need to worry you can use pandas and numpy on your new m1 with the help of rosetta 2. 

Install Python3

1st we will see how we can setup python3 on m1 Mac , the process is quite simple open terminal on your m1 Mac and type python3 and hit enter if you have already installed python then an interactive  python shell will open,  if you haven't install then it will say that given package is not installed, it need developer tools and will ask you if you want to install press return python3 will be installed.

Install Jupyter Notebook

Open terminal and type the following command

pip3 install jupyterlab 

After typing this command press enter , your package will begin to install. Check if any warning is raised that given package is not on path. if such warning is raised this means your python package is not installed on PATh. You have to add the path shown in warning to your Macos path variable. After adding the path shown in warning to users $PATH . Type. jupyter-lab on your terminal and press enter. Hurray Jupiter Notebook    is installed on your m1(Please note that if no warning was thrown during pip install then your installation was successful you don't have to add any path to PATH variable).

Install Numpy and Pandas

As mentioned in the beginning  numpy and pandas are natively not supported by m1 Macs so we will use rosetta 2 to install them.

We will open the Mac terminal with rosetta 2 and here below is the step by step guide to open terminal with rosetta2. 

Step1 : 1st of all install rosetta2 on your Mac, open terminal and type the below command and press return.

softwareupdate --install-rosetta

Step2 : After that long press the terminal and click on options and then click on show in finder.



Step3 : After that in Finder select terminal and then press the control key and simultaneously click on Touch Bar , then click on get info.



Step4 : A pop up will appear in that select Open using Rosetta.



Hurray from know onwards your terminal will open with rosetta until and unless you uncheck the checkbox in step 4.

Now open a new terminal window and type the below commands.

pip3 install numpy


pip3 install pandas


This is the complete procedure for setting up numpy , Jupiter notebook and pandas on your m1 Mac.

For any suggestion or improvement feel free to write it in comment box.

Comments

  1. This is, by far, the most lucid and simple set of explanations to get the pandas up and running in M1 mac! The instructions I found everywhere else were just a little too geeky!

    ReplyDelete

Post a Comment

Popular posts from this blog

M1 MacBook Air For Development (A Student Review)

Android Tv Tips And Tricks