Setup OpenCV for Python on Mac

A particular method that works on M1 and Intel!

Rémy Villulles
2 min readSep 25, 2022
Photo by Miguel Á. Padriñán: https://www.pexels.com/photo/photo-of-emoticon-artwork-806408/

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

--

--

Rémy Villulles

Fullstack developer, I love learning new technologies and try to stay up to date with the newest features