How To Install Python Packages Using Apple M1 Chips

blog
Data Engineering

How To Install Python Packages Using Apple M1 Chips

Apple M1 chip was launched on November, 2020. Installing python packages like spacy, scikit learn, numpy are a bit difficult in it so this article will take you step by step to install these.

Step 1

Install the rosetta terminal using the below link

/usr/sbin/softwareupdate --install-rosetta --agree-to-license

Step 2

One needs to confirm that he/she is using the rosetta terminal. To check whether the terminal being used is native or rosetta, go to terminal and type arch. If output is arm64, then the terminal is native and if output is i386 then is rosetta.

Step 3

Install brew using the below command

arch -x86_64 /bin/bash -c "$(curl -fsSL
https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Step 4

Install python using brew because it will also install any development packages if needed using the below command

arch -x86_64 brew install python@3.x

where x is your version that you need to install

Step 5

It is important to export the path of python@3.x to the .zshrc file. While installing python using the step 4 instruction will be given in the terminal how to export it to the .zshrc file.

Step 6

It is important to add path to the system because if there are multiple python added, one needs to make the system understand to use this python as the default python. Use the below step to achieve this

export PATH="/usr/local/opt/python@3.x/bin:$PATH"

Note: Please see where python@3.x is installed so if there is any tweak needed at this step, one can do it.

Comments (02)

user

Tom Shires

1 months ago

Reply

Does Python packages work on the Apple M1 chip

review

Sarah Myers

1 months ago

Reply

yes the Orcawise data science team discovered the solution

review

Sanpreet

1 weeks ago

Reply

Yes we have proven this process for the M1 chip.

Leave A Comment

Subscribe For Newsletter

Subscribe to our newsletter & stay updated