Skip to content

Instantly share code, notes, and snippets.

@umbertogriffo
Last active February 24, 2023 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save umbertogriffo/f2bab83c9c9d8ff2793ae8115e50b359 to your computer and use it in GitHub Desktop.
Save umbertogriffo/f2bab83c9c9d8ff2793ae8115e50b359 to your computer and use it in GitHub Desktop.
MacOS 12 M1 (Apple Silicon) - Build OpenCV

MacOS 12 M1 (Apple Silicon) - Build OpenCV

Install CMake (3.16 or higher):

brew install cmake

If it's already installed, uninstall opencv-python:

pip uninstall opencv-python
# or
pipenv uninstall opencv-python

Run the following commands:

curl https://files.pythonhosted.org/packages/40/93/655af887bafece2a655998f53b9bd21ad94b0627d81d44aef35c79f40de6/opencv-python-4.7.0.72.tar.gz > opencv.tar.gz
tar -xzvf opencv.tar.gz
cd opencv-python-4.7.0.72
python3 setup.py install
cd ../..
rm -rf opencv-python-4.7.0.72
rm -rf opencv.tar.gz

If tou get ModuleNotFoundError: No module named 'skbuild' run:

pip3 install scikit-build==0.16.7

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment