[MacOS] How to Install TensorFlow, PyTorch, Transformers/Hugging Face Libraries on M1/M2/M3?

Talib
4 min readJun 3, 2024

If you have a windows machine then installing and running LLM will be smooth with intel chips; however, what about Mac users? Don’t worry, I got you covered.

Note: This tutorial covers all the possible errors and troubleshooting steps for them.

Requirements

  • Mac computers with Apple silicon or AMD GPUs
  • macOS 12.0 or later (Get the latest beta)
  • Python 3.8 or later
  • Xcode command-line tools: xcode-select --install

Follow the below steps, it solves all the possible errors you might be getting.

Step 1: Rosetta Terminal

Make sure that your terminal is Rosetta 2 enabled before you continue:

Finder>Applications>Utilities>Terminal(Right Click)>Get Info>Open using Rosetta

Step 2: Install Rust arch i386 terminal

Run this command, if you are wondering where did I get this script from, I got it from the RUST’s…

--

--

Talib
Talib

Written by Talib

I like breaking down complex concepts in simple words LinkedIn: linkedin.com/in/talibilat Sign up to my newsletter: talibilat.substack.com

Responses (2)