Skip to content

Can't build 4.5 wheels on MacOS Python 3.10 - Bump numpy to 1.21.4 #692

Description

@Avasam

Expected behaviour

opencv-python 4.5 to correctly install on x86_64 MacOs Python 3.10

Actual behaviour

It seems numpy is pinned to 1.21.2, which doesn't contain build wheels for Python 3.10 on Mac.
numpy-1.21.4 does install correctly.
I cannot currently use opencv-python 4.6 because of an issue with PyInstaller (See pyinstaller/pyinstaller#6889 and pyinstaller/pyinstaller-hooks-contrib#110 (comment) for more details)

MacOS Python 3.10 opencv-python-headless>=4.5.4,<4.6
Collecting opencv-python-headless<4.6,>=4.5.4
Using cached opencv-python-headless-4.5.5.64.tar.gz (89.9 MB)
Installing build dependencies ... error
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [212 lines of output]
Ignoring numpy: markers 'python_version =="3.6" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
Ignoring numpy: markers 'python_version =="3.7" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
Ignoring numpy: markers 'python_version =="3.8" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
Ignoring numpy: markers 'python_version <="3.9" and sys_platform =="linux" and platform_machine =="aarch64"' don't match your environment
Ignoring numpy: markers 'python_version <="3.9" and sys_platform =="darwin" and platform_machine =="arm64"' don't match your environment
Ignoring numpy: markers 'python_version =="3.9" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
Collecting setuptools
Using cached setuptools-63.2.0-py3-none-any.whl (1.2 MB)
Collecting wheel
Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Collecting scikit-build
Using cached scikit_build-0.15.0-py2.py3-none-any.whl (77 kB)
Collecting cmake
Using cached cmake-3.22.5-py2.py3-none-macosx_10_10_universal2.macosx_10_10_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl (75.2 MB)
Collecting pip
Using cached pip-22.2-py3-none-any.whl (2.0 MB)
Collecting numpy==1.21.2
Using cached numpy-1.21.2.zip (10.3 MB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting distro
Using cached distro-1.7.0-py3-none-any.whl (20 kB)
Collecting packaging
Using cached packaging-21.3-py3-none-any.whl (40 kB)
Collecting pyparsing!=3.0.5,>=2.0.2
Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB)
Building wheels for collected packages: numpy
Building wheel for numpy (pyproject.toml): started
Building wheel for numpy (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error
× Building wheel for numpy (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [168 lines of output]
setup.py:63: RuntimeWarning: NumPy 1.21.2 may not yet support Python 3.10.
warnings.warn(
Running from numpy source directory.
/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/tools/cythonize.py:69: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
from distutils.version import LooseVersion
Processing numpy/random/_bounded_integers.pxd.in
Processing numpy/random/_philox.pyx
Processing numpy/random/_bounded_integers.pyx.in
Processing numpy/random/_sfc64.pyx
Processing numpy/random/_mt19937.pyx
Processing numpy/random/bit_generator.pyx
Processing numpy/random/mtrand.pyx
Processing numpy/random/_generator.pyx
Processing numpy/random/_pcg64.pyx
Processing numpy/random/_common.pyx
Cythonizing sources
blas_opt_info:
blas_mkl_info:
customize UnixCCompiler
libraries mkl_rt not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
NOT AVAILABLE
blis_info:
libraries blis not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
NOT AVAILABLE
openblas_info:
libraries openblas not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
NOT AVAILABLE
accelerate_info:
libraries accelerate not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
Library accelerate was not found. Ignoring
libraries veclib not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
Library veclib was not found. Ignoring
FOUND:
extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
FOUND:
extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
non-existing path in 'numpy/distutils': 'site.cfg'
lapack_opt_info:
lapack_mkl_info:
libraries mkl_rt not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
NOT AVAILABLE
openblas_lapack_info:
libraries openblas not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
NOT AVAILABLE
openblas_clapack_info:
libraries openblas,lapack not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
NOT AVAILABLE
flame_info:
libraries flame not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
NOT AVAILABLE
FOUND:
extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
Warning: attempted relative import with no known parent package
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
warnings.warn(msg)
running bdist_wheel
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building py_modules sources
creating build
creating build/src.macosx-10.9-universal2-3.10
creating build/src.macosx-10.9-universal2-3.10/numpy
creating build/src.macosx-10.9-universal2-3.10/numpy/distutils
building library "npymath" sources
Could not locate executable gfortran
Could not locate executable f95
Could not locate executable f90
Could not locate executable f77
Could not locate executable xlf90
Could not locate executable xlf
Could not locate executable ifort
Could not locate executable ifc
Could not locate executable g77
Could not locate executable g95
Could not locate executable pgfortran
don't know how to compile Fortran code on platform 'posix'
creating build/src.macosx-10.9-universal2-3.10/numpy/core
creating build/src.macosx-10.9-universal2-3.10/numpy/core/src
creating build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath
conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/npy_math_internal.h
adding 'build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath' to include_dirs.
conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/ieee754.c
conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/npy_math_complex.c
None - nothing done with h_files = ['build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/npy_math_internal.h']
building library "npyrandom" sources
building extension "numpy.core._multiarray_tests" sources
creating build/src.macosx-10.9-universal2-3.10/numpy/core/src/multiarray
conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/multiarray/_multiarray_tests.c
building extension "numpy.core._multiarray_umath" sources
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
main()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 211, in build_wheel
return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 197, in _build_with_temp_dir
self.run_setup()
File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 248, in run_setup
super(_BuildMetaLegacyBackend,
File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 142, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 448, in <module>
setup_package()
File "setup.py", line 440, in setup_package
setup(**metadata)
File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/core.py", line 169, in setup
return old_setup(**new_attr)
File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 165, in setup
return distutils.core.setup(**attrs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/core.py", line 148, in setup
dist.run_commands()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 299, in run
self.run_command('build')
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build.py", line 61, in run
old_build.run(self)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 144, in run
self.build_sources()
File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 161, in build_sources
self.build_extension_sources(ext)
File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 318, in build_extension_sources
sources = self.generate_sources(sources, ext)
File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 378, in generate_sources
source = func(extension, build_dir)
File "numpy/core/setup.py", line 434, in generate_config_h
moredefs, ignored = cocache.check_types(config_cmd, ext, build_dir)
File "numpy/core/setup.py", line 44, in check_types
out = check_types(*a, **kw)
File "numpy/core/setup.py", line 289, in check_types
raise SystemError(
SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for numpy
Failed to build numpy
ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.

Steps to reproduce

  • Be on MacOS
  • Use Python 3.10
  • Run pip3 install "opencv-python-headless>=4.5.4,<4.6"
  • See error above
Issue submission checklist
  • This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
  • I have read the README of this repository and understand that this repository provides only an automated build toolchain for OpenCV Python packages (there is no actual OpenCV code here)
  • The issue is related to the build scripts in this repository, to the pre-built binaries or is a feature request (such as "please enable this additional dependency")
  • I'm using the latest version of opencv-python
    (I am not, see issue description)

This is not a duplicate of #525 or #559 as numpy was only bumped to 1.21.2 in #556 which didn't bring Python 3.10 build wheel support to x86_64 MacOS as can clearly be seen in my log above. As well as this mention in 1.21.4 release notes:

This release also provides thin x86_64 Mac wheels for Python 3.10.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    , 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
     blocks
    (function() {
    function addCopyButtons() {
    document.querySelectorAll('pre code').forEach(function(codeBlock) {
    if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
    codeBlock.parentElement.setAttribute('data-copy-added', 'true');
    var btn = document.createElement('button');
    btn.textContent = 'Copy';
    btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
    btn.onmouseover = function() { this.style.opacity = '1'; };
    btn.onmouseout = function() { this.style.opacity = '0.7'; };
    btn.onclick = function() {
    navigator.clipboard.writeText(codeBlock.textContent).then(function() {
    btn.textContent = 'Copied!';
    setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
    });
    };
    codeBlock.parentElement.style.position = 'relative';
    codeBlock.parentElement.appendChild(btn);
    });
    }
    addCopyButtons();
    // Re-run on dynamic content
    var observer = new MutationObserver(addCopyButtons);
    observer.observe(document.body, { childList: true, subtree: true });
    })();
    }
    } catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
    })();
    (function(){
    try {
    var __m = "github.com";
    var __re = new RegExp('^' + "github\\.com" + '
    Can't build 4.5 wheels on MacOS Python 3.10 - Bump numpy to 1.21.4 · Issue #692 · opencv/opencv-python · GitHub
    Skip to content

    Can't build 4.5 wheels on MacOS Python 3.10 - Bump numpy to 1.21.4 #692

    Description

    @Avasam

    Expected behaviour

    opencv-python 4.5 to correctly install on x86_64 MacOs Python 3.10

    Actual behaviour

    It seems numpy is pinned to 1.21.2, which doesn't contain build wheels for Python 3.10 on Mac.
    numpy-1.21.4 does install correctly.
    I cannot currently use opencv-python 4.6 because of an issue with PyInstaller (See pyinstaller/pyinstaller#6889 and pyinstaller/pyinstaller-hooks-contrib#110 (comment) for more details)

    MacOS Python 3.10 opencv-python-headless>=4.5.4,<4.6
    Collecting opencv-python-headless<4.6,>=4.5.4
    Using cached opencv-python-headless-4.5.5.64.tar.gz (89.9 MB)
    Installing build dependencies ... error
    error: subprocess-exited-with-error
    × pip subprocess to install build dependencies did not run successfully.
    │ exit code: 1
    ╰─> [212 lines of output]
    Ignoring numpy: markers 'python_version =="3.6" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
    Ignoring numpy: markers 'python_version =="3.7" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
    Ignoring numpy: markers 'python_version =="3.8" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
    Ignoring numpy: markers 'python_version <="3.9" and sys_platform =="linux" and platform_machine =="aarch64"' don't match your environment
    Ignoring numpy: markers 'python_version <="3.9" and sys_platform =="darwin" and platform_machine =="arm64"' don't match your environment
    Ignoring numpy: markers 'python_version =="3.9" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
    Collecting setuptools
    Using cached setuptools-63.2.0-py3-none-any.whl (1.2 MB)
    Collecting wheel
    Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
    Collecting scikit-build
    Using cached scikit_build-0.15.0-py2.py3-none-any.whl (77 kB)
    Collecting cmake
    Using cached cmake-3.22.5-py2.py3-none-macosx_10_10_universal2.macosx_10_10_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl (75.2 MB)
    Collecting pip
    Using cached pip-22.2-py3-none-any.whl (2.0 MB)
    Collecting numpy==1.21.2
    Using cached numpy-1.21.2.zip (10.3 MB)
    Installing build dependencies: started
    Installing build dependencies: finished with status 'done'
    Getting requirements to build wheel: started
    Getting requirements to build wheel: finished with status 'done'
    Preparing metadata (pyproject.toml): started
    Preparing metadata (pyproject.toml): finished with status 'done'
    Collecting distro
    Using cached distro-1.7.0-py3-none-any.whl (20 kB)
    Collecting packaging
    Using cached packaging-21.3-py3-none-any.whl (40 kB)
    Collecting pyparsing!=3.0.5,>=2.0.2
    Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB)
    Building wheels for collected packages: numpy
    Building wheel for numpy (pyproject.toml): started
    Building wheel for numpy (pyproject.toml): finished with status 'error'
    error: subprocess-exited-with-error
    × Building wheel for numpy (pyproject.toml) did not run successfully.
    │ exit code: 1
    ╰─> [168 lines of output]
    setup.py:63: RuntimeWarning: NumPy 1.21.2 may not yet support Python 3.10.
    warnings.warn(
    Running from numpy source directory.
    /private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/tools/cythonize.py:69: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
    from distutils.version import LooseVersion
    Processing numpy/random/_bounded_integers.pxd.in
    Processing numpy/random/_philox.pyx
    Processing numpy/random/_bounded_integers.pyx.in
    Processing numpy/random/_sfc64.pyx
    Processing numpy/random/_mt19937.pyx
    Processing numpy/random/bit_generator.pyx
    Processing numpy/random/mtrand.pyx
    Processing numpy/random/_generator.pyx
    Processing numpy/random/_pcg64.pyx
    Processing numpy/random/_common.pyx
    Cythonizing sources
    blas_opt_info:
    blas_mkl_info:
    customize UnixCCompiler
    libraries mkl_rt not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
    NOT AVAILABLE
    blis_info:
    libraries blis not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
    NOT AVAILABLE
    openblas_info:
    libraries openblas not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
    NOT AVAILABLE
    accelerate_info:
    libraries accelerate not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
    Library accelerate was not found. Ignoring
    libraries veclib not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
    Library veclib was not found. Ignoring
    FOUND:
    extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
    extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
    define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
    FOUND:
    extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
    extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
    define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
    non-existing path in 'numpy/distutils': 'site.cfg'
    lapack_opt_info:
    lapack_mkl_info:
    libraries mkl_rt not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
    NOT AVAILABLE
    openblas_lapack_info:
    libraries openblas not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
    NOT AVAILABLE
    openblas_clapack_info:
    libraries openblas,lapack not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
    NOT AVAILABLE
    flame_info:
    libraries flame not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
    NOT AVAILABLE
    FOUND:
    extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
    extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
    define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
    Warning: attempted relative import with no known parent package
    /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
    warnings.warn(msg)
    running bdist_wheel
    running build
    running config_cc
    unifing config_cc, config, build_clib, build_ext, build commands --compiler options
    running config_fc
    unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
    running build_src
    build_src
    building py_modules sources
    creating build
    creating build/src.macosx-10.9-universal2-3.10
    creating build/src.macosx-10.9-universal2-3.10/numpy
    creating build/src.macosx-10.9-universal2-3.10/numpy/distutils
    building library "npymath" sources
    Could not locate executable gfortran
    Could not locate executable f95
    Could not locate executable f90
    Could not locate executable f77
    Could not locate executable xlf90
    Could not locate executable xlf
    Could not locate executable ifort
    Could not locate executable ifc
    Could not locate executable g77
    Could not locate executable g95
    Could not locate executable pgfortran
    don't know how to compile Fortran code on platform 'posix'
    creating build/src.macosx-10.9-universal2-3.10/numpy/core
    creating build/src.macosx-10.9-universal2-3.10/numpy/core/src
    creating build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath
    conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/npy_math_internal.h
    adding 'build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath' to include_dirs.
    conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/ieee754.c
    conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/npy_math_complex.c
    None - nothing done with h_files = ['build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/npy_math_internal.h']
    building library "npyrandom" sources
    building extension "numpy.core._multiarray_tests" sources
    creating build/src.macosx-10.9-universal2-3.10/numpy/core/src/multiarray
    conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/multiarray/_multiarray_tests.c
    building extension "numpy.core._multiarray_umath" sources
    Traceback (most recent call last):
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
    main()
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
    return _build_backend().build_wheel(wheel_directory, config_settings,
    File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 211, in build_wheel
    return self._build_with_temp_dir(['bdist_wheel'], '.whl',
    File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 197, in _build_with_temp_dir
    self.run_setup()
    File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 248, in run_setup
    super(_BuildMetaLegacyBackend,
    File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 142, in run_setup
    exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 448, in <module>
    setup_package()
    File "setup.py", line 440, in setup_package
    setup(**metadata)
    File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/core.py", line 169, in setup
    return old_setup(**new_attr)
    File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 165, in setup
    return distutils.core.setup(**attrs)
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/core.py", line 148, in setup
    dist.run_commands()
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
    File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 299, in run
    self.run_command('build')
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
    File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build.py", line 61, in run
    old_build.run(self)
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
    File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
    File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 144, in run
    self.build_sources()
    File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 161, in build_sources
    self.build_extension_sources(ext)
    File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 318, in build_extension_sources
    sources = self.generate_sources(sources, ext)
    File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 378, in generate_sources
    source = func(extension, build_dir)
    File "numpy/core/setup.py", line 434, in generate_config_h
    moredefs, ignored = cocache.check_types(config_cmd, ext, build_dir)
    File "numpy/core/setup.py", line 44, in check_types
    out = check_types(*a, **kw)
    File "numpy/core/setup.py", line 289, in check_types
    raise SystemError(
    SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
    [end of output]
    note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed building wheel for numpy
    Failed to build numpy
    ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
    [end of output]
    note: This error originates from a subprocess, and is likely not a problem with pip.
    error: subprocess-exited-with-error
    × pip subprocess to install build dependencies did not run successfully.
    │ exit code: 1
    ╰─> See above for output.
    note: This error originates from a subprocess, and is likely not a problem with pip.

    Steps to reproduce

    • Be on MacOS
    • Use Python 3.10
    • Run pip3 install "opencv-python-headless>=4.5.4,<4.6"
    • See error above
    Issue submission checklist
    • This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
    • I have read the README of this repository and understand that this repository provides only an automated build toolchain for OpenCV Python packages (there is no actual OpenCV code here)
    • The issue is related to the build scripts in this repository, to the pre-built binaries or is a feature request (such as "please enable this additional dependency")
    • I'm using the latest version of opencv-python
      (I am not, see issue description)

    This is not a duplicate of #525 or #559 as numpy was only bumped to 1.21.2 in #556 which didn't bring Python 3.10 build wheel support to x86_64 MacOS as can clearly be seen in my log above. As well as this mention in 1.21.4 release notes:

    This release also provides thin x86_64 Mac wheels for Python 3.10.

    Metadata

    Metadata

    Assignees

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      , 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Can't build 4.5 wheels on MacOS Python 3.10 - Bump numpy to 1.21.4 · Issue #692 · opencv/opencv-python · GitHub
      Skip to content

      Can't build 4.5 wheels on MacOS Python 3.10 - Bump numpy to 1.21.4 #692

      Description

      @Avasam

      Expected behaviour

      opencv-python 4.5 to correctly install on x86_64 MacOs Python 3.10

      Actual behaviour

      It seems numpy is pinned to 1.21.2, which doesn't contain build wheels for Python 3.10 on Mac.
      numpy-1.21.4 does install correctly.
      I cannot currently use opencv-python 4.6 because of an issue with PyInstaller (See pyinstaller/pyinstaller#6889 and pyinstaller/pyinstaller-hooks-contrib#110 (comment) for more details)

      MacOS Python 3.10 opencv-python-headless>=4.5.4,<4.6
      Collecting opencv-python-headless<4.6,>=4.5.4
      Using cached opencv-python-headless-4.5.5.64.tar.gz (89.9 MB)
      Installing build dependencies ... error
      error: subprocess-exited-with-error
      × pip subprocess to install build dependencies did not run successfully.
      │ exit code: 1
      ╰─> [212 lines of output]
      Ignoring numpy: markers 'python_version =="3.6" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
      Ignoring numpy: markers 'python_version =="3.7" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
      Ignoring numpy: markers 'python_version =="3.8" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
      Ignoring numpy: markers 'python_version <="3.9" and sys_platform =="linux" and platform_machine =="aarch64"' don't match your environment
      Ignoring numpy: markers 'python_version <="3.9" and sys_platform =="darwin" and platform_machine =="arm64"' don't match your environment
      Ignoring numpy: markers 'python_version =="3.9" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
      Collecting setuptools
      Using cached setuptools-63.2.0-py3-none-any.whl (1.2 MB)
      Collecting wheel
      Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
      Collecting scikit-build
      Using cached scikit_build-0.15.0-py2.py3-none-any.whl (77 kB)
      Collecting cmake
      Using cached cmake-3.22.5-py2.py3-none-macosx_10_10_universal2.macosx_10_10_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl (75.2 MB)
      Collecting pip
      Using cached pip-22.2-py3-none-any.whl (2.0 MB)
      Collecting numpy==1.21.2
      Using cached numpy-1.21.2.zip (10.3 MB)
      Installing build dependencies: started
      Installing build dependencies: finished with status 'done'
      Getting requirements to build wheel: started
      Getting requirements to build wheel: finished with status 'done'
      Preparing metadata (pyproject.toml): started
      Preparing metadata (pyproject.toml): finished with status 'done'
      Collecting distro
      Using cached distro-1.7.0-py3-none-any.whl (20 kB)
      Collecting packaging
      Using cached packaging-21.3-py3-none-any.whl (40 kB)
      Collecting pyparsing!=3.0.5,>=2.0.2
      Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB)
      Building wheels for collected packages: numpy
      Building wheel for numpy (pyproject.toml): started
      Building wheel for numpy (pyproject.toml): finished with status 'error'
      error: subprocess-exited-with-error
      × Building wheel for numpy (pyproject.toml) did not run successfully.
      │ exit code: 1
      ╰─> [168 lines of output]
      setup.py:63: RuntimeWarning: NumPy 1.21.2 may not yet support Python 3.10.
      warnings.warn(
      Running from numpy source directory.
      /private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/tools/cythonize.py:69: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
      from distutils.version import LooseVersion
      Processing numpy/random/_bounded_integers.pxd.in
      Processing numpy/random/_philox.pyx
      Processing numpy/random/_bounded_integers.pyx.in
      Processing numpy/random/_sfc64.pyx
      Processing numpy/random/_mt19937.pyx
      Processing numpy/random/bit_generator.pyx
      Processing numpy/random/mtrand.pyx
      Processing numpy/random/_generator.pyx
      Processing numpy/random/_pcg64.pyx
      Processing numpy/random/_common.pyx
      Cythonizing sources
      blas_opt_info:
      blas_mkl_info:
      customize UnixCCompiler
      libraries mkl_rt not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
      NOT AVAILABLE
      blis_info:
      libraries blis not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
      NOT AVAILABLE
      openblas_info:
      libraries openblas not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
      NOT AVAILABLE
      accelerate_info:
      libraries accelerate not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
      Library accelerate was not found. Ignoring
      libraries veclib not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
      Library veclib was not found. Ignoring
      FOUND:
      extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
      extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
      define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
      FOUND:
      extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
      extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
      define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
      non-existing path in 'numpy/distutils': 'site.cfg'
      lapack_opt_info:
      lapack_mkl_info:
      libraries mkl_rt not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
      NOT AVAILABLE
      openblas_lapack_info:
      libraries openblas not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
      NOT AVAILABLE
      openblas_clapack_info:
      libraries openblas,lapack not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
      NOT AVAILABLE
      flame_info:
      libraries flame not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
      NOT AVAILABLE
      FOUND:
      extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
      extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
      define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
      Warning: attempted relative import with no known parent package
      /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
      warnings.warn(msg)
      running bdist_wheel
      running build
      running config_cc
      unifing config_cc, config, build_clib, build_ext, build commands --compiler options
      running config_fc
      unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
      running build_src
      build_src
      building py_modules sources
      creating build
      creating build/src.macosx-10.9-universal2-3.10
      creating build/src.macosx-10.9-universal2-3.10/numpy
      creating build/src.macosx-10.9-universal2-3.10/numpy/distutils
      building library "npymath" sources
      Could not locate executable gfortran
      Could not locate executable f95
      Could not locate executable f90
      Could not locate executable f77
      Could not locate executable xlf90
      Could not locate executable xlf
      Could not locate executable ifort
      Could not locate executable ifc
      Could not locate executable g77
      Could not locate executable g95
      Could not locate executable pgfortran
      don't know how to compile Fortran code on platform 'posix'
      creating build/src.macosx-10.9-universal2-3.10/numpy/core
      creating build/src.macosx-10.9-universal2-3.10/numpy/core/src
      creating build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath
      conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/npy_math_internal.h
      adding 'build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath' to include_dirs.
      conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/ieee754.c
      conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/npy_math_complex.c
      None - nothing done with h_files = ['build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/npy_math_internal.h']
      building library "npyrandom" sources
      building extension "numpy.core._multiarray_tests" sources
      creating build/src.macosx-10.9-universal2-3.10/numpy/core/src/multiarray
      conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/multiarray/_multiarray_tests.c
      building extension "numpy.core._multiarray_umath" sources
      Traceback (most recent call last):
      File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
      main()
      File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
      File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
      return _build_backend().build_wheel(wheel_directory, config_settings,
      File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 211, in build_wheel
      return self._build_with_temp_dir(['bdist_wheel'], '.whl',
      File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 197, in _build_with_temp_dir
      self.run_setup()
      File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 248, in run_setup
      super(_BuildMetaLegacyBackend,
      File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 142, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
      File "setup.py", line 448, in <module>
      setup_package()
      File "setup.py", line 440, in setup_package
      setup(**metadata)
      File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/core.py", line 169, in setup
      return old_setup(**new_attr)
      File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 165, in setup
      return distutils.core.setup(**attrs)
      File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/core.py", line 148, in setup
      dist.run_commands()
      File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
      File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
      File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 299, in run
      self.run_command('build')
      File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
      File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
      File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build.py", line 61, in run
      old_build.run(self)
      File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
      File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
      File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
      File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 144, in run
      self.build_sources()
      File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 161, in build_sources
      self.build_extension_sources(ext)
      File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 318, in build_extension_sources
      sources = self.generate_sources(sources, ext)
      File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 378, in generate_sources
      source = func(extension, build_dir)
      File "numpy/core/setup.py", line 434, in generate_config_h
      moredefs, ignored = cocache.check_types(config_cmd, ext, build_dir)
      File "numpy/core/setup.py", line 44, in check_types
      out = check_types(*a, **kw)
      File "numpy/core/setup.py", line 289, in check_types
      raise SystemError(
      SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
      [end of output]
      note: This error originates from a subprocess, and is likely not a problem with pip.
      ERROR: Failed building wheel for numpy
      Failed to build numpy
      ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
      [end of output]
      note: This error originates from a subprocess, and is likely not a problem with pip.
      error: subprocess-exited-with-error
      × pip subprocess to install build dependencies did not run successfully.
      │ exit code: 1
      ╰─> See above for output.
      note: This error originates from a subprocess, and is likely not a problem with pip.

      Steps to reproduce

      • Be on MacOS
      • Use Python 3.10
      • Run pip3 install "opencv-python-headless>=4.5.4,<4.6"
      • See error above
      Issue submission checklist
      • This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
      • I have read the README of this repository and understand that this repository provides only an automated build toolchain for OpenCV Python packages (there is no actual OpenCV code here)
      • The issue is related to the build scripts in this repository, to the pre-built binaries or is a feature request (such as "please enable this additional dependency")
      • I'm using the latest version of opencv-python
        (I am not, see issue description)

      This is not a duplicate of #525 or #559 as numpy was only bumped to 1.21.2 in #556 which didn't bring Python 3.10 build wheel support to x86_64 MacOS as can clearly be seen in my log above. As well as this mention in 1.21.4 release notes:

      This release also provides thin x86_64 Mac wheels for Python 3.10.

      Metadata

      Metadata

      Assignees

      Labels

      No labels
      No labels

      Type

      No type

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions

        , 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Can't build 4.5 wheels on MacOS Python 3.10 - Bump numpy to 1.21.4 · Issue #692 · opencv/opencv-python · GitHub
        Skip to content

        Can't build 4.5 wheels on MacOS Python 3.10 - Bump numpy to 1.21.4 #692

        Description

        @Avasam

        Expected behaviour

        opencv-python 4.5 to correctly install on x86_64 MacOs Python 3.10

        Actual behaviour

        It seems numpy is pinned to 1.21.2, which doesn't contain build wheels for Python 3.10 on Mac.
        numpy-1.21.4 does install correctly.
        I cannot currently use opencv-python 4.6 because of an issue with PyInstaller (See pyinstaller/pyinstaller#6889 and pyinstaller/pyinstaller-hooks-contrib#110 (comment) for more details)

        MacOS Python 3.10 opencv-python-headless>=4.5.4,<4.6
        Collecting opencv-python-headless<4.6,>=4.5.4
        Using cached opencv-python-headless-4.5.5.64.tar.gz (89.9 MB)
        Installing build dependencies ... error
        error: subprocess-exited-with-error
        × pip subprocess to install build dependencies did not run successfully.
        │ exit code: 1
        ╰─> [212 lines of output]
        Ignoring numpy: markers 'python_version =="3.6" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
        Ignoring numpy: markers 'python_version =="3.7" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
        Ignoring numpy: markers 'python_version =="3.8" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
        Ignoring numpy: markers 'python_version <="3.9" and sys_platform =="linux" and platform_machine =="aarch64"' don't match your environment
        Ignoring numpy: markers 'python_version <="3.9" and sys_platform =="darwin" and platform_machine =="arm64"' don't match your environment
        Ignoring numpy: markers 'python_version =="3.9" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
        Collecting setuptools
        Using cached setuptools-63.2.0-py3-none-any.whl (1.2 MB)
        Collecting wheel
        Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
        Collecting scikit-build
        Using cached scikit_build-0.15.0-py2.py3-none-any.whl (77 kB)
        Collecting cmake
        Using cached cmake-3.22.5-py2.py3-none-macosx_10_10_universal2.macosx_10_10_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl (75.2 MB)
        Collecting pip
        Using cached pip-22.2-py3-none-any.whl (2.0 MB)
        Collecting numpy==1.21.2
        Using cached numpy-1.21.2.zip (10.3 MB)
        Installing build dependencies: started
        Installing build dependencies: finished with status 'done'
        Getting requirements to build wheel: started
        Getting requirements to build wheel: finished with status 'done'
        Preparing metadata (pyproject.toml): started
        Preparing metadata (pyproject.toml): finished with status 'done'
        Collecting distro
        Using cached distro-1.7.0-py3-none-any.whl (20 kB)
        Collecting packaging
        Using cached packaging-21.3-py3-none-any.whl (40 kB)
        Collecting pyparsing!=3.0.5,>=2.0.2
        Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB)
        Building wheels for collected packages: numpy
        Building wheel for numpy (pyproject.toml): started
        Building wheel for numpy (pyproject.toml): finished with status 'error'
        error: subprocess-exited-with-error
        × Building wheel for numpy (pyproject.toml) did not run successfully.
        │ exit code: 1
        ╰─> [168 lines of output]
        setup.py:63: RuntimeWarning: NumPy 1.21.2 may not yet support Python 3.10.
        warnings.warn(
        Running from numpy source directory.
        /private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/tools/cythonize.py:69: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
        from distutils.version import LooseVersion
        Processing numpy/random/_bounded_integers.pxd.in
        Processing numpy/random/_philox.pyx
        Processing numpy/random/_bounded_integers.pyx.in
        Processing numpy/random/_sfc64.pyx
        Processing numpy/random/_mt19937.pyx
        Processing numpy/random/bit_generator.pyx
        Processing numpy/random/mtrand.pyx
        Processing numpy/random/_generator.pyx
        Processing numpy/random/_pcg64.pyx
        Processing numpy/random/_common.pyx
        Cythonizing sources
        blas_opt_info:
        blas_mkl_info:
        customize UnixCCompiler
        libraries mkl_rt not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
        blis_info:
        libraries blis not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
        openblas_info:
        libraries openblas not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
        accelerate_info:
        libraries accelerate not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
        Library accelerate was not found. Ignoring
        libraries veclib not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
        Library veclib was not found. Ignoring
        FOUND:
        extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
        extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
        define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
        FOUND:
        extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
        extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
        define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
        non-existing path in 'numpy/distutils': 'site.cfg'
        lapack_opt_info:
        lapack_mkl_info:
        libraries mkl_rt not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
        openblas_lapack_info:
        libraries openblas not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
        openblas_clapack_info:
        libraries openblas,lapack not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
        flame_info:
        libraries flame not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
        NOT AVAILABLE
        FOUND:
        extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
        extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
        define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
        Warning: attempted relative import with no known parent package
        /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
        warnings.warn(msg)
        running bdist_wheel
        running build
        running config_cc
        unifing config_cc, config, build_clib, build_ext, build commands --compiler options
        running config_fc
        unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
        running build_src
        build_src
        building py_modules sources
        creating build
        creating build/src.macosx-10.9-universal2-3.10
        creating build/src.macosx-10.9-universal2-3.10/numpy
        creating build/src.macosx-10.9-universal2-3.10/numpy/distutils
        building library "npymath" sources
        Could not locate executable gfortran
        Could not locate executable f95
        Could not locate executable f90
        Could not locate executable f77
        Could not locate executable xlf90
        Could not locate executable xlf
        Could not locate executable ifort
        Could not locate executable ifc
        Could not locate executable g77
        Could not locate executable g95
        Could not locate executable pgfortran
        don't know how to compile Fortran code on platform 'posix'
        creating build/src.macosx-10.9-universal2-3.10/numpy/core
        creating build/src.macosx-10.9-universal2-3.10/numpy/core/src
        creating build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath
        conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/npy_math_internal.h
        adding 'build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath' to include_dirs.
        conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/ieee754.c
        conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/npy_math_complex.c
        None - nothing done with h_files = ['build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/npy_math_internal.h']
        building library "npyrandom" sources
        building extension "numpy.core._multiarray_tests" sources
        creating build/src.macosx-10.9-universal2-3.10/numpy/core/src/multiarray
        conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/multiarray/_multiarray_tests.c
        building extension "numpy.core._multiarray_umath" sources
        Traceback (most recent call last):
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
        main()
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
        json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
        return _build_backend().build_wheel(wheel_directory, config_settings,
        File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 211, in build_wheel
        return self._build_with_temp_dir(['bdist_wheel'], '.whl',
        File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 197, in _build_with_temp_dir
        self.run_setup()
        File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 248, in run_setup
        super(_BuildMetaLegacyBackend,
        File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 142, in run_setup
        exec(compile(code, __file__, 'exec'), locals())
        File "setup.py", line 448, in <module>
        setup_package()
        File "setup.py", line 440, in setup_package
        setup(**metadata)
        File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/core.py", line 169, in setup
        return old_setup(**new_attr)
        File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 165, in setup
        return distutils.core.setup(**attrs)
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/core.py", line 148, in setup
        dist.run_commands()
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
        File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 299, in run
        self.run_command('build')
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
        File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build.py", line 61, in run
        old_build.run(self)
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
        File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 144, in run
        self.build_sources()
        File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 161, in build_sources
        self.build_extension_sources(ext)
        File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 318, in build_extension_sources
        sources = self.generate_sources(sources, ext)
        File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 378, in generate_sources
        source = func(extension, build_dir)
        File "numpy/core/setup.py", line 434, in generate_config_h
        moredefs, ignored = cocache.check_types(config_cmd, ext, build_dir)
        File "numpy/core/setup.py", line 44, in check_types
        out = check_types(*a, **kw)
        File "numpy/core/setup.py", line 289, in check_types
        raise SystemError(
        SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
        [end of output]
        note: This error originates from a subprocess, and is likely not a problem with pip.
        ERROR: Failed building wheel for numpy
        Failed to build numpy
        ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
        [end of output]
        note: This error originates from a subprocess, and is likely not a problem with pip.
        error: subprocess-exited-with-error
        × pip subprocess to install build dependencies did not run successfully.
        │ exit code: 1
        ╰─> See above for output.
        note: This error originates from a subprocess, and is likely not a problem with pip.

        Steps to reproduce

        • Be on MacOS
        • Use Python 3.10
        • Run pip3 install "opencv-python-headless>=4.5.4,<4.6"
        • See error above
        Issue submission checklist
        • This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
        • I have read the README of this repository and understand that this repository provides only an automated build toolchain for OpenCV Python packages (there is no actual OpenCV code here)
        • The issue is related to the build scripts in this repository, to the pre-built binaries or is a feature request (such as "please enable this additional dependency")
        • I'm using the latest version of opencv-python
          (I am not, see issue description)

        This is not a duplicate of #525 or #559 as numpy was only bumped to 1.21.2 in #556 which didn't bring Python 3.10 build wheel support to x86_64 MacOS as can clearly be seen in my log above. As well as this mention in 1.21.4 release notes:

        This release also provides thin x86_64 Mac wheels for Python 3.10.

        Metadata

        Metadata

        Assignees

        Labels

        No labels
        No labels

        Type

        No type

        Projects

        No projects

          Milestone

          No milestone

          Relationships

          None yet

          Development

          No branches or pull requests

          Issue actions

          , 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' Can't build 4.5 wheels on MacOS Python 3.10 - Bump numpy to 1.21.4 · Issue #692 · opencv/opencv-python · GitHub
          Skip to content

          Can't build 4.5 wheels on MacOS Python 3.10 - Bump numpy to 1.21.4 #692

          Description

          @Avasam

          Expected behaviour

          opencv-python 4.5 to correctly install on x86_64 MacOs Python 3.10

          Actual behaviour

          It seems numpy is pinned to 1.21.2, which doesn't contain build wheels for Python 3.10 on Mac.
          numpy-1.21.4 does install correctly.
          I cannot currently use opencv-python 4.6 because of an issue with PyInstaller (See pyinstaller/pyinstaller#6889 and pyinstaller/pyinstaller-hooks-contrib#110 (comment) for more details)

          MacOS Python 3.10 opencv-python-headless>=4.5.4,<4.6
          Collecting opencv-python-headless<4.6,>=4.5.4
          Using cached opencv-python-headless-4.5.5.64.tar.gz (89.9 MB)
          Installing build dependencies ... error
          error: subprocess-exited-with-error
          × pip subprocess to install build dependencies did not run successfully.
          │ exit code: 1
          ╰─> [212 lines of output]
          Ignoring numpy: markers 'python_version =="3.6" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
          Ignoring numpy: markers 'python_version =="3.7" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
          Ignoring numpy: markers 'python_version =="3.8" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
          Ignoring numpy: markers 'python_version <="3.9" and sys_platform =="linux" and platform_machine =="aarch64"' don't match your environment
          Ignoring numpy: markers 'python_version <="3.9" and sys_platform =="darwin" and platform_machine =="arm64"' don't match your environment
          Ignoring numpy: markers 'python_version =="3.9" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
          Collecting setuptools
          Using cached setuptools-63.2.0-py3-none-any.whl (1.2 MB)
          Collecting wheel
          Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
          Collecting scikit-build
          Using cached scikit_build-0.15.0-py2.py3-none-any.whl (77 kB)
          Collecting cmake
          Using cached cmake-3.22.5-py2.py3-none-macosx_10_10_universal2.macosx_10_10_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl (75.2 MB)
          Collecting pip
          Using cached pip-22.2-py3-none-any.whl (2.0 MB)
          Collecting numpy==1.21.2
          Using cached numpy-1.21.2.zip (10.3 MB)
          Installing build dependencies: started
          Installing build dependencies: finished with status 'done'
          Getting requirements to build wheel: started
          Getting requirements to build wheel: finished with status 'done'
          Preparing metadata (pyproject.toml): started
          Preparing metadata (pyproject.toml): finished with status 'done'
          Collecting distro
          Using cached distro-1.7.0-py3-none-any.whl (20 kB)
          Collecting packaging
          Using cached packaging-21.3-py3-none-any.whl (40 kB)
          Collecting pyparsing!=3.0.5,>=2.0.2
          Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB)
          Building wheels for collected packages: numpy
          Building wheel for numpy (pyproject.toml): started
          Building wheel for numpy (pyproject.toml): finished with status 'error'
          error: subprocess-exited-with-error
          × Building wheel for numpy (pyproject.toml) did not run successfully.
          │ exit code: 1
          ╰─> [168 lines of output]
          setup.py:63: RuntimeWarning: NumPy 1.21.2 may not yet support Python 3.10.
          warnings.warn(
          Running from numpy source directory.
          /private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/tools/cythonize.py:69: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
          from distutils.version import LooseVersion
          Processing numpy/random/_bounded_integers.pxd.in
          Processing numpy/random/_philox.pyx
          Processing numpy/random/_bounded_integers.pyx.in
          Processing numpy/random/_sfc64.pyx
          Processing numpy/random/_mt19937.pyx
          Processing numpy/random/bit_generator.pyx
          Processing numpy/random/mtrand.pyx
          Processing numpy/random/_generator.pyx
          Processing numpy/random/_pcg64.pyx
          Processing numpy/random/_common.pyx
          Cythonizing sources
          blas_opt_info:
          blas_mkl_info:
          customize UnixCCompiler
          libraries mkl_rt not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
          NOT AVAILABLE
          blis_info:
          libraries blis not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
          NOT AVAILABLE
          openblas_info:
          libraries openblas not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
          NOT AVAILABLE
          accelerate_info:
          libraries accelerate not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
          Library accelerate was not found. Ignoring
          libraries veclib not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
          Library veclib was not found. Ignoring
          FOUND:
          extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
          extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
          define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
          FOUND:
          extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
          extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
          define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
          non-existing path in 'numpy/distutils': 'site.cfg'
          lapack_opt_info:
          lapack_mkl_info:
          libraries mkl_rt not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
          NOT AVAILABLE
          openblas_lapack_info:
          libraries openblas not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
          NOT AVAILABLE
          openblas_clapack_info:
          libraries openblas,lapack not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
          NOT AVAILABLE
          flame_info:
          libraries flame not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
          NOT AVAILABLE
          FOUND:
          extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
          extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
          define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
          Warning: attempted relative import with no known parent package
          /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
          warnings.warn(msg)
          running bdist_wheel
          running build
          running config_cc
          unifing config_cc, config, build_clib, build_ext, build commands --compiler options
          running config_fc
          unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
          running build_src
          build_src
          building py_modules sources
          creating build
          creating build/src.macosx-10.9-universal2-3.10
          creating build/src.macosx-10.9-universal2-3.10/numpy
          creating build/src.macosx-10.9-universal2-3.10/numpy/distutils
          building library "npymath" sources
          Could not locate executable gfortran
          Could not locate executable f95
          Could not locate executable f90
          Could not locate executable f77
          Could not locate executable xlf90
          Could not locate executable xlf
          Could not locate executable ifort
          Could not locate executable ifc
          Could not locate executable g77
          Could not locate executable g95
          Could not locate executable pgfortran
          don't know how to compile Fortran code on platform 'posix'
          creating build/src.macosx-10.9-universal2-3.10/numpy/core
          creating build/src.macosx-10.9-universal2-3.10/numpy/core/src
          creating build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath
          conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/npy_math_internal.h
          adding 'build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath' to include_dirs.
          conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/ieee754.c
          conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/npy_math_complex.c
          None - nothing done with h_files = ['build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/npy_math_internal.h']
          building library "npyrandom" sources
          building extension "numpy.core._multiarray_tests" sources
          creating build/src.macosx-10.9-universal2-3.10/numpy/core/src/multiarray
          conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/multiarray/_multiarray_tests.c
          building extension "numpy.core._multiarray_umath" sources
          Traceback (most recent call last):
          File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
          File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
          File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
          File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 211, in build_wheel
          return self._build_with_temp_dir(['bdist_wheel'], '.whl',
          File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 197, in _build_with_temp_dir
          self.run_setup()
          File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 248, in run_setup
          super(_BuildMetaLegacyBackend,
          File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 142, in run_setup
          exec(compile(code, __file__, 'exec'), locals())
          File "setup.py", line 448, in <module>
          setup_package()
          File "setup.py", line 440, in setup_package
          setup(**metadata)
          File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/core.py", line 169, in setup
          return old_setup(**new_attr)
          File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 165, in setup
          return distutils.core.setup(**attrs)
          File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/core.py", line 148, in setup
          dist.run_commands()
          File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 966, in run_commands
          self.run_command(cmd)
          File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
          cmd_obj.run()
          File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 299, in run
          self.run_command('build')
          File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
          File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
          cmd_obj.run()
          File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build.py", line 61, in run
          old_build.run(self)
          File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/command/build.py", line 135, in run
          self.run_command(cmd_name)
          File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
          File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
          cmd_obj.run()
          File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 144, in run
          self.build_sources()
          File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 161, in build_sources
          self.build_extension_sources(ext)
          File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 318, in build_extension_sources
          sources = self.generate_sources(sources, ext)
          File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 378, in generate_sources
          source = func(extension, build_dir)
          File "numpy/core/setup.py", line 434, in generate_config_h
          moredefs, ignored = cocache.check_types(config_cmd, ext, build_dir)
          File "numpy/core/setup.py", line 44, in check_types
          out = check_types(*a, **kw)
          File "numpy/core/setup.py", line 289, in check_types
          raise SystemError(
          SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
          [end of output]
          note: This error originates from a subprocess, and is likely not a problem with pip.
          ERROR: Failed building wheel for numpy
          Failed to build numpy
          ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
          [end of output]
          note: This error originates from a subprocess, and is likely not a problem with pip.
          error: subprocess-exited-with-error
          × pip subprocess to install build dependencies did not run successfully.
          │ exit code: 1
          ╰─> See above for output.
          note: This error originates from a subprocess, and is likely not a problem with pip.

          Steps to reproduce

          • Be on MacOS
          • Use Python 3.10
          • Run pip3 install "opencv-python-headless>=4.5.4,<4.6"
          • See error above
          Issue submission checklist
          • This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
          • I have read the README of this repository and understand that this repository provides only an automated build toolchain for OpenCV Python packages (there is no actual OpenCV code here)
          • The issue is related to the build scripts in this repository, to the pre-built binaries or is a feature request (such as "please enable this additional dependency")
          • I'm using the latest version of opencv-python
            (I am not, see issue description)

          This is not a duplicate of #525 or #559 as numpy was only bumped to 1.21.2 in #556 which didn't bring Python 3.10 build wheel support to x86_64 MacOS as can clearly be seen in my log above. As well as this mention in 1.21.4 release notes:

          This release also provides thin x86_64 Mac wheels for Python 3.10.

          Metadata

          Metadata

          Assignees

          Labels

          No labels
          No labels

          Type

          No type

          Projects

          No projects

            Milestone

            No milestone

            Relationships

            None yet

            Development

            No branches or pull requests

            Issue actions

            , 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Can't build 4.5 wheels on MacOS Python 3.10 - Bump numpy to 1.21.4 · Issue #692 · opencv/opencv-python · GitHub
            Skip to content

            Can't build 4.5 wheels on MacOS Python 3.10 - Bump numpy to 1.21.4 #692

            Description

            @Avasam

            Expected behaviour

            opencv-python 4.5 to correctly install on x86_64 MacOs Python 3.10

            Actual behaviour

            It seems numpy is pinned to 1.21.2, which doesn't contain build wheels for Python 3.10 on Mac.
            numpy-1.21.4 does install correctly.
            I cannot currently use opencv-python 4.6 because of an issue with PyInstaller (See pyinstaller/pyinstaller#6889 and pyinstaller/pyinstaller-hooks-contrib#110 (comment) for more details)

            MacOS Python 3.10 opencv-python-headless>=4.5.4,<4.6
            Collecting opencv-python-headless<4.6,>=4.5.4
            Using cached opencv-python-headless-4.5.5.64.tar.gz (89.9 MB)
            Installing build dependencies ... error
            error: subprocess-exited-with-error
            × pip subprocess to install build dependencies did not run successfully.
            │ exit code: 1
            ╰─> [212 lines of output]
            Ignoring numpy: markers 'python_version =="3.6" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
            Ignoring numpy: markers 'python_version =="3.7" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
            Ignoring numpy: markers 'python_version =="3.8" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
            Ignoring numpy: markers 'python_version <="3.9" and sys_platform =="linux" and platform_machine =="aarch64"' don't match your environment
            Ignoring numpy: markers 'python_version <="3.9" and sys_platform =="darwin" and platform_machine =="arm64"' don't match your environment
            Ignoring numpy: markers 'python_version =="3.9" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
            Collecting setuptools
            Using cached setuptools-63.2.0-py3-none-any.whl (1.2 MB)
            Collecting wheel
            Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
            Collecting scikit-build
            Using cached scikit_build-0.15.0-py2.py3-none-any.whl (77 kB)
            Collecting cmake
            Using cached cmake-3.22.5-py2.py3-none-macosx_10_10_universal2.macosx_10_10_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl (75.2 MB)
            Collecting pip
            Using cached pip-22.2-py3-none-any.whl (2.0 MB)
            Collecting numpy==1.21.2
            Using cached numpy-1.21.2.zip (10.3 MB)
            Installing build dependencies: started
            Installing build dependencies: finished with status 'done'
            Getting requirements to build wheel: started
            Getting requirements to build wheel: finished with status 'done'
            Preparing metadata (pyproject.toml): started
            Preparing metadata (pyproject.toml): finished with status 'done'
            Collecting distro
            Using cached distro-1.7.0-py3-none-any.whl (20 kB)
            Collecting packaging
            Using cached packaging-21.3-py3-none-any.whl (40 kB)
            Collecting pyparsing!=3.0.5,>=2.0.2
            Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB)
            Building wheels for collected packages: numpy
            Building wheel for numpy (pyproject.toml): started
            Building wheel for numpy (pyproject.toml): finished with status 'error'
            error: subprocess-exited-with-error
            × Building wheel for numpy (pyproject.toml) did not run successfully.
            │ exit code: 1
            ╰─> [168 lines of output]
            setup.py:63: RuntimeWarning: NumPy 1.21.2 may not yet support Python 3.10.
            warnings.warn(
            Running from numpy source directory.
            /private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/tools/cythonize.py:69: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
            from distutils.version import LooseVersion
            Processing numpy/random/_bounded_integers.pxd.in
            Processing numpy/random/_philox.pyx
            Processing numpy/random/_bounded_integers.pyx.in
            Processing numpy/random/_sfc64.pyx
            Processing numpy/random/_mt19937.pyx
            Processing numpy/random/bit_generator.pyx
            Processing numpy/random/mtrand.pyx
            Processing numpy/random/_generator.pyx
            Processing numpy/random/_pcg64.pyx
            Processing numpy/random/_common.pyx
            Cythonizing sources
            blas_opt_info:
            blas_mkl_info:
            customize UnixCCompiler
            libraries mkl_rt not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
            NOT AVAILABLE
            blis_info:
            libraries blis not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
            NOT AVAILABLE
            openblas_info:
            libraries openblas not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
            NOT AVAILABLE
            accelerate_info:
            libraries accelerate not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
            Library accelerate was not found. Ignoring
            libraries veclib not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
            Library veclib was not found. Ignoring
            FOUND:
            extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
            extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
            define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
            FOUND:
            extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
            extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
            define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
            non-existing path in 'numpy/distutils': 'site.cfg'
            lapack_opt_info:
            lapack_mkl_info:
            libraries mkl_rt not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
            NOT AVAILABLE
            openblas_lapack_info:
            libraries openblas not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
            NOT AVAILABLE
            openblas_clapack_info:
            libraries openblas,lapack not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
            NOT AVAILABLE
            flame_info:
            libraries flame not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
            NOT AVAILABLE
            FOUND:
            extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
            extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
            define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
            Warning: attempted relative import with no known parent package
            /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
            warnings.warn(msg)
            running bdist_wheel
            running build
            running config_cc
            unifing config_cc, config, build_clib, build_ext, build commands --compiler options
            running config_fc
            unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
            running build_src
            build_src
            building py_modules sources
            creating build
            creating build/src.macosx-10.9-universal2-3.10
            creating build/src.macosx-10.9-universal2-3.10/numpy
            creating build/src.macosx-10.9-universal2-3.10/numpy/distutils
            building library "npymath" sources
            Could not locate executable gfortran
            Could not locate executable f95
            Could not locate executable f90
            Could not locate executable f77
            Could not locate executable xlf90
            Could not locate executable xlf
            Could not locate executable ifort
            Could not locate executable ifc
            Could not locate executable g77
            Could not locate executable g95
            Could not locate executable pgfortran
            don't know how to compile Fortran code on platform 'posix'
            creating build/src.macosx-10.9-universal2-3.10/numpy/core
            creating build/src.macosx-10.9-universal2-3.10/numpy/core/src
            creating build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath
            conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/npy_math_internal.h
            adding 'build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath' to include_dirs.
            conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/ieee754.c
            conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/npy_math_complex.c
            None - nothing done with h_files = ['build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/npy_math_internal.h']
            building library "npyrandom" sources
            building extension "numpy.core._multiarray_tests" sources
            creating build/src.macosx-10.9-universal2-3.10/numpy/core/src/multiarray
            conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/multiarray/_multiarray_tests.c
            building extension "numpy.core._multiarray_umath" sources
            Traceback (most recent call last):
            File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
            main()
            File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
            json_out['return_val'] = hook(**hook_input['kwargs'])
            File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
            return _build_backend().build_wheel(wheel_directory, config_settings,
            File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 211, in build_wheel
            return self._build_with_temp_dir(['bdist_wheel'], '.whl',
            File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 197, in _build_with_temp_dir
            self.run_setup()
            File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 248, in run_setup
            super(_BuildMetaLegacyBackend,
            File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 142, in run_setup
            exec(compile(code, __file__, 'exec'), locals())
            File "setup.py", line 448, in <module>
            setup_package()
            File "setup.py", line 440, in setup_package
            setup(**metadata)
            File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/core.py", line 169, in setup
            return old_setup(**new_attr)
            File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 165, in setup
            return distutils.core.setup(**attrs)
            File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/core.py", line 148, in setup
            dist.run_commands()
            File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 966, in run_commands
            self.run_command(cmd)
            File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
            cmd_obj.run()
            File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 299, in run
            self.run_command('build')
            File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/cmd.py", line 313, in run_command
            self.distribution.run_command(command)
            File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
            cmd_obj.run()
            File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build.py", line 61, in run
            old_build.run(self)
            File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/command/build.py", line 135, in run
            self.run_command(cmd_name)
            File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/cmd.py", line 313, in run_command
            self.distribution.run_command(command)
            File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
            cmd_obj.run()
            File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 144, in run
            self.build_sources()
            File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 161, in build_sources
            self.build_extension_sources(ext)
            File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 318, in build_extension_sources
            sources = self.generate_sources(sources, ext)
            File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 378, in generate_sources
            source = func(extension, build_dir)
            File "numpy/core/setup.py", line 434, in generate_config_h
            moredefs, ignored = cocache.check_types(config_cmd, ext, build_dir)
            File "numpy/core/setup.py", line 44, in check_types
            out = check_types(*a, **kw)
            File "numpy/core/setup.py", line 289, in check_types
            raise SystemError(
            SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
            [end of output]
            note: This error originates from a subprocess, and is likely not a problem with pip.
            ERROR: Failed building wheel for numpy
            Failed to build numpy
            ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
            [end of output]
            note: This error originates from a subprocess, and is likely not a problem with pip.
            error: subprocess-exited-with-error
            × pip subprocess to install build dependencies did not run successfully.
            │ exit code: 1
            ╰─> See above for output.
            note: This error originates from a subprocess, and is likely not a problem with pip.

            Steps to reproduce

            • Be on MacOS
            • Use Python 3.10
            • Run pip3 install "opencv-python-headless>=4.5.4,<4.6"
            • See error above
            Issue submission checklist
            • This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
            • I have read the README of this repository and understand that this repository provides only an automated build toolchain for OpenCV Python packages (there is no actual OpenCV code here)
            • The issue is related to the build scripts in this repository, to the pre-built binaries or is a feature request (such as "please enable this additional dependency")
            • I'm using the latest version of opencv-python
              (I am not, see issue description)

            This is not a duplicate of #525 or #559 as numpy was only bumped to 1.21.2 in #556 which didn't bring Python 3.10 build wheel support to x86_64 MacOS as can clearly be seen in my log above. As well as this mention in 1.21.4 release notes:

            This release also provides thin x86_64 Mac wheels for Python 3.10.

            Metadata

            Metadata

            Assignees

            Labels

            No labels
            No labels

            Type

            No type

            Projects

            No projects

              Milestone

              No milestone

              Relationships

              None yet

              Development

              No branches or pull requests

              Issue actions

              , 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Can't build 4.5 wheels on MacOS Python 3.10 - Bump numpy to 1.21.4 · Issue #692 · opencv/opencv-python · GitHub
              Skip to content

              Can't build 4.5 wheels on MacOS Python 3.10 - Bump numpy to 1.21.4 #692

              Description

              @Avasam

              Expected behaviour

              opencv-python 4.5 to correctly install on x86_64 MacOs Python 3.10

              Actual behaviour

              It seems numpy is pinned to 1.21.2, which doesn't contain build wheels for Python 3.10 on Mac.
              numpy-1.21.4 does install correctly.
              I cannot currently use opencv-python 4.6 because of an issue with PyInstaller (See pyinstaller/pyinstaller#6889 and pyinstaller/pyinstaller-hooks-contrib#110 (comment) for more details)

              MacOS Python 3.10 opencv-python-headless>=4.5.4,<4.6
              Collecting opencv-python-headless<4.6,>=4.5.4
              Using cached opencv-python-headless-4.5.5.64.tar.gz (89.9 MB)
              Installing build dependencies ... error
              error: subprocess-exited-with-error
              × pip subprocess to install build dependencies did not run successfully.
              │ exit code: 1
              ╰─> [212 lines of output]
              Ignoring numpy: markers 'python_version =="3.6" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
              Ignoring numpy: markers 'python_version =="3.7" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
              Ignoring numpy: markers 'python_version =="3.8" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
              Ignoring numpy: markers 'python_version <="3.9" and sys_platform =="linux" and platform_machine =="aarch64"' don't match your environment
              Ignoring numpy: markers 'python_version <="3.9" and sys_platform =="darwin" and platform_machine =="arm64"' don't match your environment
              Ignoring numpy: markers 'python_version =="3.9" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
              Collecting setuptools
              Using cached setuptools-63.2.0-py3-none-any.whl (1.2 MB)
              Collecting wheel
              Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
              Collecting scikit-build
              Using cached scikit_build-0.15.0-py2.py3-none-any.whl (77 kB)
              Collecting cmake
              Using cached cmake-3.22.5-py2.py3-none-macosx_10_10_universal2.macosx_10_10_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl (75.2 MB)
              Collecting pip
              Using cached pip-22.2-py3-none-any.whl (2.0 MB)
              Collecting numpy==1.21.2
              Using cached numpy-1.21.2.zip (10.3 MB)
              Installing build dependencies: started
              Installing build dependencies: finished with status 'done'
              Getting requirements to build wheel: started
              Getting requirements to build wheel: finished with status 'done'
              Preparing metadata (pyproject.toml): started
              Preparing metadata (pyproject.toml): finished with status 'done'
              Collecting distro
              Using cached distro-1.7.0-py3-none-any.whl (20 kB)
              Collecting packaging
              Using cached packaging-21.3-py3-none-any.whl (40 kB)
              Collecting pyparsing!=3.0.5,>=2.0.2
              Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB)
              Building wheels for collected packages: numpy
              Building wheel for numpy (pyproject.toml): started
              Building wheel for numpy (pyproject.toml): finished with status 'error'
              error: subprocess-exited-with-error
              × Building wheel for numpy (pyproject.toml) did not run successfully.
              │ exit code: 1
              ╰─> [168 lines of output]
              setup.py:63: RuntimeWarning: NumPy 1.21.2 may not yet support Python 3.10.
              warnings.warn(
              Running from numpy source directory.
              /private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/tools/cythonize.py:69: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
              from distutils.version import LooseVersion
              Processing numpy/random/_bounded_integers.pxd.in
              Processing numpy/random/_philox.pyx
              Processing numpy/random/_bounded_integers.pyx.in
              Processing numpy/random/_sfc64.pyx
              Processing numpy/random/_mt19937.pyx
              Processing numpy/random/bit_generator.pyx
              Processing numpy/random/mtrand.pyx
              Processing numpy/random/_generator.pyx
              Processing numpy/random/_pcg64.pyx
              Processing numpy/random/_common.pyx
              Cythonizing sources
              blas_opt_info:
              blas_mkl_info:
              customize UnixCCompiler
              libraries mkl_rt not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
              NOT AVAILABLE
              blis_info:
              libraries blis not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
              NOT AVAILABLE
              openblas_info:
              libraries openblas not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
              NOT AVAILABLE
              accelerate_info:
              libraries accelerate not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
              Library accelerate was not found. Ignoring
              libraries veclib not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
              Library veclib was not found. Ignoring
              FOUND:
              extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
              extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
              define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
              FOUND:
              extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
              extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
              define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
              non-existing path in 'numpy/distutils': 'site.cfg'
              lapack_opt_info:
              lapack_mkl_info:
              libraries mkl_rt not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
              NOT AVAILABLE
              openblas_lapack_info:
              libraries openblas not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
              NOT AVAILABLE
              openblas_clapack_info:
              libraries openblas,lapack not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
              NOT AVAILABLE
              flame_info:
              libraries flame not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
              NOT AVAILABLE
              FOUND:
              extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
              extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
              define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
              Warning: attempted relative import with no known parent package
              /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
              warnings.warn(msg)
              running bdist_wheel
              running build
              running config_cc
              unifing config_cc, config, build_clib, build_ext, build commands --compiler options
              running config_fc
              unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
              running build_src
              build_src
              building py_modules sources
              creating build
              creating build/src.macosx-10.9-universal2-3.10
              creating build/src.macosx-10.9-universal2-3.10/numpy
              creating build/src.macosx-10.9-universal2-3.10/numpy/distutils
              building library "npymath" sources
              Could not locate executable gfortran
              Could not locate executable f95
              Could not locate executable f90
              Could not locate executable f77
              Could not locate executable xlf90
              Could not locate executable xlf
              Could not locate executable ifort
              Could not locate executable ifc
              Could not locate executable g77
              Could not locate executable g95
              Could not locate executable pgfortran
              don't know how to compile Fortran code on platform 'posix'
              creating build/src.macosx-10.9-universal2-3.10/numpy/core
              creating build/src.macosx-10.9-universal2-3.10/numpy/core/src
              creating build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath
              conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/npy_math_internal.h
              adding 'build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath' to include_dirs.
              conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/ieee754.c
              conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/npy_math_complex.c
              None - nothing done with h_files = ['build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/npy_math_internal.h']
              building library "npyrandom" sources
              building extension "numpy.core._multiarray_tests" sources
              creating build/src.macosx-10.9-universal2-3.10/numpy/core/src/multiarray
              conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/multiarray/_multiarray_tests.c
              building extension "numpy.core._multiarray_umath" sources
              Traceback (most recent call last):
              File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
              main()
              File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
              json_out['return_val'] = hook(**hook_input['kwargs'])
              File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
              return _build_backend().build_wheel(wheel_directory, config_settings,
              File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 211, in build_wheel
              return self._build_with_temp_dir(['bdist_wheel'], '.whl',
              File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 197, in _build_with_temp_dir
              self.run_setup()
              File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 248, in run_setup
              super(_BuildMetaLegacyBackend,
              File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 142, in run_setup
              exec(compile(code, __file__, 'exec'), locals())
              File "setup.py", line 448, in <module>
              setup_package()
              File "setup.py", line 440, in setup_package
              setup(**metadata)
              File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/core.py", line 169, in setup
              return old_setup(**new_attr)
              File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 165, in setup
              return distutils.core.setup(**attrs)
              File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/core.py", line 148, in setup
              dist.run_commands()
              File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 966, in run_commands
              self.run_command(cmd)
              File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
              cmd_obj.run()
              File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 299, in run
              self.run_command('build')
              File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/cmd.py", line 313, in run_command
              self.distribution.run_command(command)
              File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
              cmd_obj.run()
              File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build.py", line 61, in run
              old_build.run(self)
              File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/command/build.py", line 135, in run
              self.run_command(cmd_name)
              File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/cmd.py", line 313, in run_command
              self.distribution.run_command(command)
              File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
              cmd_obj.run()
              File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 144, in run
              self.build_sources()
              File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 161, in build_sources
              self.build_extension_sources(ext)
              File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 318, in build_extension_sources
              sources = self.generate_sources(sources, ext)
              File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 378, in generate_sources
              source = func(extension, build_dir)
              File "numpy/core/setup.py", line 434, in generate_config_h
              moredefs, ignored = cocache.check_types(config_cmd, ext, build_dir)
              File "numpy/core/setup.py", line 44, in check_types
              out = check_types(*a, **kw)
              File "numpy/core/setup.py", line 289, in check_types
              raise SystemError(
              SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
              [end of output]
              note: This error originates from a subprocess, and is likely not a problem with pip.
              ERROR: Failed building wheel for numpy
              Failed to build numpy
              ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
              [end of output]
              note: This error originates from a subprocess, and is likely not a problem with pip.
              error: subprocess-exited-with-error
              × pip subprocess to install build dependencies did not run successfully.
              │ exit code: 1
              ╰─> See above for output.
              note: This error originates from a subprocess, and is likely not a problem with pip.

              Steps to reproduce

              • Be on MacOS
              • Use Python 3.10
              • Run pip3 install "opencv-python-headless>=4.5.4,<4.6"
              • See error above
              Issue submission checklist
              • This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
              • I have read the README of this repository and understand that this repository provides only an automated build toolchain for OpenCV Python packages (there is no actual OpenCV code here)
              • The issue is related to the build scripts in this repository, to the pre-built binaries or is a feature request (such as "please enable this additional dependency")
              • I'm using the latest version of opencv-python
                (I am not, see issue description)

              This is not a duplicate of #525 or #559 as numpy was only bumped to 1.21.2 in #556 which didn't bring Python 3.10 build wheel support to x86_64 MacOS as can clearly be seen in my log above. As well as this mention in 1.21.4 release notes:

              This release also provides thin x86_64 Mac wheels for Python 3.10.

              Metadata

              Metadata

              Assignees

              Labels

              No labels
              No labels

              Type

              No type

              Projects

              No projects

                Milestone

                No milestone

                Relationships

                None yet

                Development

                No branches or pull requests

                Issue actions

                , 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); Can't build 4.5 wheels on MacOS Python 3.10 - Bump numpy to 1.21.4 · Issue #692 · opencv/opencv-python · GitHub
                Skip to content

                Can't build 4.5 wheels on MacOS Python 3.10 - Bump numpy to 1.21.4 #692

                Description

                @Avasam

                Expected behaviour

                opencv-python 4.5 to correctly install on x86_64 MacOs Python 3.10

                Actual behaviour

                It seems numpy is pinned to 1.21.2, which doesn't contain build wheels for Python 3.10 on Mac.
                numpy-1.21.4 does install correctly.
                I cannot currently use opencv-python 4.6 because of an issue with PyInstaller (See pyinstaller/pyinstaller#6889 and pyinstaller/pyinstaller-hooks-contrib#110 (comment) for more details)

                MacOS Python 3.10 opencv-python-headless>=4.5.4,<4.6
                Collecting opencv-python-headless<4.6,>=4.5.4
                Using cached opencv-python-headless-4.5.5.64.tar.gz (89.9 MB)
                Installing build dependencies ... error
                error: subprocess-exited-with-error
                × pip subprocess to install build dependencies did not run successfully.
                │ exit code: 1
                ╰─> [212 lines of output]
                Ignoring numpy: markers 'python_version =="3.6" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
                Ignoring numpy: markers 'python_version =="3.7" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
                Ignoring numpy: markers 'python_version =="3.8" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
                Ignoring numpy: markers 'python_version <="3.9" and sys_platform =="linux" and platform_machine =="aarch64"' don't match your environment
                Ignoring numpy: markers 'python_version <="3.9" and sys_platform =="darwin" and platform_machine =="arm64"' don't match your environment
                Ignoring numpy: markers 'python_version =="3.9" and platform_machine !="aarch64" and platform_machine !="arm64"' don't match your environment
                Collecting setuptools
                Using cached setuptools-63.2.0-py3-none-any.whl (1.2 MB)
                Collecting wheel
                Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
                Collecting scikit-build
                Using cached scikit_build-0.15.0-py2.py3-none-any.whl (77 kB)
                Collecting cmake
                Using cached cmake-3.22.5-py2.py3-none-macosx_10_10_universal2.macosx_10_10_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl (75.2 MB)
                Collecting pip
                Using cached pip-22.2-py3-none-any.whl (2.0 MB)
                Collecting numpy==1.21.2
                Using cached numpy-1.21.2.zip (10.3 MB)
                Installing build dependencies: started
                Installing build dependencies: finished with status 'done'
                Getting requirements to build wheel: started
                Getting requirements to build wheel: finished with status 'done'
                Preparing metadata (pyproject.toml): started
                Preparing metadata (pyproject.toml): finished with status 'done'
                Collecting distro
                Using cached distro-1.7.0-py3-none-any.whl (20 kB)
                Collecting packaging
                Using cached packaging-21.3-py3-none-any.whl (40 kB)
                Collecting pyparsing!=3.0.5,>=2.0.2
                Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB)
                Building wheels for collected packages: numpy
                Building wheel for numpy (pyproject.toml): started
                Building wheel for numpy (pyproject.toml): finished with status 'error'
                error: subprocess-exited-with-error
                × Building wheel for numpy (pyproject.toml) did not run successfully.
                │ exit code: 1
                ╰─> [168 lines of output]
                setup.py:63: RuntimeWarning: NumPy 1.21.2 may not yet support Python 3.10.
                warnings.warn(
                Running from numpy source directory.
                /private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/tools/cythonize.py:69: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
                from distutils.version import LooseVersion
                Processing numpy/random/_bounded_integers.pxd.in
                Processing numpy/random/_philox.pyx
                Processing numpy/random/_bounded_integers.pyx.in
                Processing numpy/random/_sfc64.pyx
                Processing numpy/random/_mt19937.pyx
                Processing numpy/random/bit_generator.pyx
                Processing numpy/random/mtrand.pyx
                Processing numpy/random/_generator.pyx
                Processing numpy/random/_pcg64.pyx
                Processing numpy/random/_common.pyx
                Cythonizing sources
                blas_opt_info:
                blas_mkl_info:
                customize UnixCCompiler
                libraries mkl_rt not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
                NOT AVAILABLE
                blis_info:
                libraries blis not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
                NOT AVAILABLE
                openblas_info:
                libraries openblas not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
                NOT AVAILABLE
                accelerate_info:
                libraries accelerate not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
                Library accelerate was not found. Ignoring
                libraries veclib not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
                Library veclib was not found. Ignoring
                FOUND:
                extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
                extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
                define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
                FOUND:
                extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
                extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
                define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
                non-existing path in 'numpy/distutils': 'site.cfg'
                lapack_opt_info:
                lapack_mkl_info:
                libraries mkl_rt not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
                NOT AVAILABLE
                openblas_lapack_info:
                libraries openblas not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
                NOT AVAILABLE
                openblas_clapack_info:
                libraries openblas,lapack not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
                NOT AVAILABLE
                flame_info:
                libraries flame not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
                NOT AVAILABLE
                FOUND:
                extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
                extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
                define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
                Warning: attempted relative import with no known parent package
                /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py:274: UserWarning: Unknown distribution option: 'define_macros'
                warnings.warn(msg)
                running bdist_wheel
                running build
                running config_cc
                unifing config_cc, config, build_clib, build_ext, build commands --compiler options
                running config_fc
                unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
                running build_src
                build_src
                building py_modules sources
                creating build
                creating build/src.macosx-10.9-universal2-3.10
                creating build/src.macosx-10.9-universal2-3.10/numpy
                creating build/src.macosx-10.9-universal2-3.10/numpy/distutils
                building library "npymath" sources
                Could not locate executable gfortran
                Could not locate executable f95
                Could not locate executable f90
                Could not locate executable f77
                Could not locate executable xlf90
                Could not locate executable xlf
                Could not locate executable ifort
                Could not locate executable ifc
                Could not locate executable g77
                Could not locate executable g95
                Could not locate executable pgfortran
                don't know how to compile Fortran code on platform 'posix'
                creating build/src.macosx-10.9-universal2-3.10/numpy/core
                creating build/src.macosx-10.9-universal2-3.10/numpy/core/src
                creating build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath
                conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/npy_math_internal.h
                adding 'build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath' to include_dirs.
                conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/ieee754.c
                conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/npy_math_complex.c
                None - nothing done with h_files = ['build/src.macosx-10.9-universal2-3.10/numpy/core/src/npymath/npy_math_internal.h']
                building library "npyrandom" sources
                building extension "numpy.core._multiarray_tests" sources
                creating build/src.macosx-10.9-universal2-3.10/numpy/core/src/multiarray
                conv_template:> build/src.macosx-10.9-universal2-3.10/numpy/core/src/multiarray/_multiarray_tests.c
                building extension "numpy.core._multiarray_umath" sources
                Traceback (most recent call last):
                File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
                main()
                File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
                json_out['return_val'] = hook(**hook_input['kwargs'])
                File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
                return _build_backend().build_wheel(wheel_directory, config_settings,
                File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 211, in build_wheel
                return self._build_with_temp_dir(['bdist_wheel'], '.whl',
                File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 197, in _build_with_temp_dir
                self.run_setup()
                File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 248, in run_setup
                super(_BuildMetaLegacyBackend,
                File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 142, in run_setup
                exec(compile(code, __file__, 'exec'), locals())
                File "setup.py", line 448, in <module>
                setup_package()
                File "setup.py", line 440, in setup_package
                setup(**metadata)
                File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/core.py", line 169, in setup
                return old_setup(**new_attr)
                File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 165, in setup
                return distutils.core.setup(**attrs)
                File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/core.py", line 148, in setup
                dist.run_commands()
                File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 966, in run_commands
                self.run_command(cmd)
                File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
                cmd_obj.run()
                File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-build-env-vozkh5ko/overlay/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 299, in run
                self.run_command('build')
                File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/cmd.py", line 313, in run_command
                self.distribution.run_command(command)
                File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
                cmd_obj.run()
                File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build.py", line 61, in run
                old_build.run(self)
                File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/command/build.py", line 135, in run
                self.run_command(cmd_name)
                File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/cmd.py", line 313, in run_command
                self.distribution.run_command(command)
                File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 985, in run_command
                cmd_obj.run()
                File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 144, in run
                self.build_sources()
                File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 161, in build_sources
                self.build_extension_sources(ext)
                File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 318, in build_extension_sources
                sources = self.generate_sources(sources, ext)
                File "/private/var/folders/pq/fcm14lvx33584r8lmkkmmzfw0000gn/T/pip-install-dnxvwotj/numpy_90683b37b79642ca867de6df03c4f715/numpy/distutils/command/build_src.py", line 378, in generate_sources
                source = func(extension, build_dir)
                File "numpy/core/setup.py", line 434, in generate_config_h
                moredefs, ignored = cocache.check_types(config_cmd, ext, build_dir)
                File "numpy/core/setup.py", line 44, in check_types
                out = check_types(*a, **kw)
                File "numpy/core/setup.py", line 289, in check_types
                raise SystemError(
                SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
                [end of output]
                note: This error originates from a subprocess, and is likely not a problem with pip.
                ERROR: Failed building wheel for numpy
                Failed to build numpy
                ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects
                [end of output]
                note: This error originates from a subprocess, and is likely not a problem with pip.
                error: subprocess-exited-with-error
                × pip subprocess to install build dependencies did not run successfully.
                │ exit code: 1
                ╰─> See above for output.
                note: This error originates from a subprocess, and is likely not a problem with pip.

                Steps to reproduce

                • Be on MacOS
                • Use Python 3.10
                • Run pip3 install "opencv-python-headless>=4.5.4,<4.6"
                • See error above
                Issue submission checklist
                • This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
                • I have read the README of this repository and understand that this repository provides only an automated build toolchain for OpenCV Python packages (there is no actual OpenCV code here)
                • The issue is related to the build scripts in this repository, to the pre-built binaries or is a feature request (such as "please enable this additional dependency")
                • I'm using the latest version of opencv-python
                  (I am not, see issue description)

                This is not a duplicate of #525 or #559 as numpy was only bumped to 1.21.2 in #556 which didn't bring Python 3.10 build wheel support to x86_64 MacOS as can clearly be seen in my log above. As well as this mention in 1.21.4 release notes:

                This release also provides thin x86_64 Mac wheels for Python 3.10.

                Metadata

                Metadata

                Assignees

                Labels

                No labels
                No labels

                Type

                No type

                Projects

                No projects

                  Milestone

                  No milestone

                  Relationships

                  None yet

                  Development

                  No branches or pull requests

                  Issue actions