Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install fails on macOS 11 Big Sur. #418

Closed
4 tasks done
rgov opened this issue Nov 28, 2020 · 5 comments
Closed
4 tasks done

Install fails on macOS 11 Big Sur. #418

rgov opened this issue Nov 28, 2020 · 5 comments

Comments

@rgov
Copy link

rgov commented Nov 28, 2020

Expected behaviour

It should install on macOS 11 Big Sur.

Actual behaviour

The build succeeds but installing the package fails with:

  ERROR: Command errored out with exit status 1:
   command: /usr/local/opt/python@3.9/bin/python3.9 /usr/local/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /var/folders/qv/vg39rskn4_s4x6d7vqrjhgr40000gn/T/tmp409lcwy4

...

  Copying files from CMake output
  Traceback (most recent call last):
    File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
      main()
    File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py", line 204, in build_wheel
      return _build_backend().build_wheel(wheel_directory, config_settings,
    File "/private/var/folders/qv/vg39rskn4_s4x6d7vqrjhgr40000gn/T/pip-build-env-ti2t09hv/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 216, in build_wheel
      return self._build_with_temp_dir(['bdist_wheel'], '.whl',
    File "/private/var/folders/qv/vg39rskn4_s4x6d7vqrjhgr40000gn/T/pip-build-env-ti2t09hv/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 202, in _build_with_temp_dir
      self.run_setup()
    File "/private/var/folders/qv/vg39rskn4_s4x6d7vqrjhgr40000gn/T/pip-build-env-ti2t09hv/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 253, in run_setup
      super(_BuildMetaLegacyBackend,
    File "/private/var/folders/qv/vg39rskn4_s4x6d7vqrjhgr40000gn/T/pip-build-env-ti2t09hv/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 145, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 452, in <module>
      main()
    File "setup.py", line 212, in main
      skbuild.setup(
    File "/private/var/folders/qv/vg39rskn4_s4x6d7vqrjhgr40000gn/T/pip-build-env-ti2t09hv/overlay/lib/python3.9/site-packages/skbuild/setuptools_wrap.py", line 621, in setup
      _classify_installed_files(cmake_manifest, package_data, package_prefixes,
    File "setup.py", line 365, in _classify_installed_files_override
      raise Exception("Not found: '%s'" % relpath_re)
  Exception: Not found: 'python/cv2[^/]*\.cpython\-39\-darwin\.so'

Full log file is attached: build-log.txt

Steps to reproduce

  • example code: N/A
  • operating system: macOS 11.0.1 "Big Sur"
  • architecture (e.g. x86): x86_64
  • opencv-python version: 4.4.0.46

I am using Python 3.9 installed with Homebrew.

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
@rgov
Copy link
Author

rgov commented Nov 28, 2020

There is a bug in pypa/packaging (avoiding link backref spam) about the incompatibility with Big Sur, perhaps this is how it manifests.

I do not see a file with a name that matches the regex being created by CMake but the temporary directory was cleaned up after the failure, so I couldn't look around.

I'll close this since there seem to be other efforts to resolve incompatibility with Big Sur.

@rgov rgov closed this as completed Nov 28, 2020
@skvark
Copy link
Member

skvark commented Nov 28, 2020

Yes, there are many Python tooling issues related to Big Sur but you have also another issue here. From the logs:

  --   OpenCV modules:
  --     To be built:                 calib3d core dnn features2d flann gapi highgui imgcodecs imgproc ml objdetect photo stitching video videoio
  --     Disabled:                    world
  --     Disabled by dependency:      -
  --     Unavailable:                 java js python2 python3 ts
  --     Applications:                -
  --     Documentation:               NO
  --     Non-free algorithms:         NO

  --   Python 3:
  --     Interpreter:                 /usr/local/Cellar/python@3.9/3.9.0_2/bin/python3.9 (ver 3.9)
  --     Libraries:                   NO
  --     numpy:                       NO (Python3 wrappers can not be generated)
  --     install path:                - 

CMake could not find numpy; maybe numpy couldn't be installed on Big Sur? Due to this, the Python static library cv2 was not built and that's why you see that error (there is no such file). It will take some time for the open source projects around there to get up-to-date with the latest major breaking changes in macOS.

@rgov
Copy link
Author

rgov commented Nov 28, 2020

Interesting. Numpy is already installed, according to pip:

Requirement already satisfied: numpy>=1.19.3 in /usr/local/lib/python3.9/site-packages (from opencv-python) (1.19.4)

I think numpy technically works but it raises a RuntimeError when it gets loaded due to a failing self-check, so perhaps CMake is assuming failure because of that.

numpy/numpy#17253

@rgov
Copy link
Author

rgov commented Nov 28, 2020

I manually unpacked the latest wheel for macOS 10.13 into my site-packages and it seems to work fine.

@rgov
Copy link
Author

rgov commented Dec 1, 2020

With the release of pip 20.3 this does not seem to be a problem anymore. pip install -U pip && pip install opencv-python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants