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.
Install the rosetta terminal using the below link
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
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.
Install brew using the below command
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Install python using brew because it will also install any development packages if needed using the below command
arch -x86_64 brew install email@example.com
where x is your version that you need to install
It is important to export the path of firstname.lastname@example.org 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.
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
Note: Please see where email@example.com is installed so if there is any tweak needed at this step, one can do it.