Setup OpenCV for Python on Mac
A particular method that works on M1 and Intel!
With the arrival of M1 chips, some programs had to adapt and work on two different architectures.
Some are doing it very well but some others are not really good at it.
Pip is one of them, installing some packages may end up in an error because pip is trying to install an amd64 package using rosetta instead of installing the (existing) package in arm.
Installing homebrew
For this to work, homebrew is going to be needed. If you don’t have it, you’ll be able to find instructions to install it there.
Installing miniforge
Miniforge is a community-driven minimalist Conda installer.
Unlike miniconda, miniforge is designed to support more architectures natively, that includes the arm64 (M1).
Also, miniforge is supported by the community and not by a company so it’s a plus!
To install miniforge, we are going to use homebrew:
brew install miniforge
Once installed, we’ll just adapt our terminal to support Conda environments:
conda init zsh