I try to use OpenCV and Tensorflow with Python on Apple silicon M1. I'm able to use Tensorflow, but install OpenCV in my environment fails
pip3 install opencv-python
Even build opencv-python by my own locally fails on numpy
git clone https://github.com/skvark/opencv-python.git
cd opencv-python
ENABLE_CONTRIB=0
ENABLE_HEADLESS=1
pip wheel . --verbose
with
ERROR: Command errored out with exit status 1: /Users/hannes/git/city-simulator/tensorflow_venv2/bin/python3 /Users/hannes/git/city-simulator/tensorflow_venv2/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/np/7ckckk8s5fd169kvnnfhjkk40000gr/T/pip-build-env-3zg4n104/overlay --no-warn-script-location -v --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel scikit-build cmake pip 'numpy==1.13.3; python_version=='"'"'3.6'"'"' and platform_machine != '"'"'aarch64'"'"'' 'numpy==1.19.3; python_version>='"'"'3.6'"'"' and sys_platform == '"'"'linux'"'"' and platform_machine == '"'"'aarch64'"'"'' 'numpy==1.14.5; python_version=='"'"'3.7'"'"' and platform_machine != '"'"'aarch64'"'"'' 'numpy==1.17.3; python_version=='"'"'3.8'"'"' and platform_machine != '"'"'aarch64'"'"'' 'numpy==1.19.3; python_version>='"'"'3.9'"'"' and platform_machine != '"'"'aarch64'"'"'' Check the logs for full command output.
Even build numpy by my own fails
git clone git@github.com:numpy/numpy.git
cd numpy
OPENBLAS="$(brew --prefix openblas)" MACOSX_DEPLOYMENT_TARGET=11.1 python3 -m pip install cython --no-use-pep517
OPENBLAS="$(brew --prefix openblas)" MACOSX_DEPLOYMENT_TARGET=11.1 python3 -m pip install numpy --no-use-pep517
OPENBLAS="$(brew --prefix openblas)" MACOSX_DEPLOYMENT_TARGET=11.1 python3 -m pip install pandas --no-use-pep517
OPENBLAS="$(brew --prefix openblas)" MACOSX_DEPLOYMENT_TARGET=11.1 python3 -m pip install pybind11 --no-use-pep517
OPENBLAS="$(brew --prefix openblas)" MACOSX_DEPLOYMENT_TARGET=11.1 python3 -m pip install scipy --no-use-pep517
brew install libjpeg zlib
python3 -m pip install pillow
python3 -m pip install matplotlib
OPENBLAS="$(brew --prefix openblas)" MACOSX_DEPLOYMENT_TARGET=11.1 python3 -m pip install scikit-learn --no-use-pep517
OPENBLAS="$(brew --prefix openblas)" MACOSX_DEPLOYMENT_TARGET=11.1 python3 -m pip install statsmodels --no-use-pep517
cd ../opencv-python
pip wheel . --verbose
pip install numpy --no-index --find-links file:///Users/hannes/git/city-simulator/numpy/numpy
all without errors, bun on last I see this
Looking in links: file:///Users/hannes/git/city-simulator/numpy/numpy
Requirement already satisfied: numpy in /Users/hannes/git/city-simulator/tensorflow_venv2/lib/python3.8/site-packages (1.18.5)
and pip wheel . --verbose still runs into same error
