Open-cv installation error for python 3.6 in conda env

I am struggling to install opencv-python for GitHub - unibas-gravis/Occlusion-Robust-MoFA . After creating an environment using conda, I ran pip install -r requirements.txt and here is the terminal output:

  Copying files from CMake output
  creating directory _skbuild/linux-x86_64-3.6/cmake-install/cv2
  copying _skbuild/linux-x86_64-3.6/cmake-install/python/cv2/python-3/ -> _skbuild/linux-x86_64-3.6/cmake-install/cv2/
  copying _skbuild/linux-x86_64-3.6/cmake-install/python/cv2/ -> _skbuild/linux-x86_64-3.6/cmake-install/cv2/
  copying _skbuild/linux-x86_64-3.6/cmake-install/python/cv2/ -> _skbuild/linux-x86_64-3.6/cmake-install/cv2/
  copying _skbuild/linux-x86_64-3.6/cmake-install/python/cv2/ -> _skbuild/linux-x86_64-3.6/cmake-install/cv2/
  copying _skbuild/linux-x86_64-3.6/cmake-install/python/cv2/ -> _skbuild/linux-x86_64-3.6/cmake-install/cv2/
  copying _skbuild/linux-x86_64-3.6/cmake-install/python/cv2/ -> _skbuild/linux-x86_64-3.6/cmake-install/cv2/
  Traceback (most recent call last):
    File "/home/cash/anaconda3/envs/MOFA/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/", line 349, in <module>
    File "/home/cash/anaconda3/envs/MOFA/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/", line 331, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/home/cash/anaconda3/envs/MOFA/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/", line 249, in build_wheel
    File "/tmp/pip-build-env-p0dpn5al/overlay/lib/python3.6/site-packages/setuptools/", line 231, in build_wheel
      wheel_directory, config_settings)
    File "/tmp/pip-build-env-p0dpn5al/overlay/lib/python3.6/site-packages/setuptools/", line 215, in _build_with_temp_dir
    File "/tmp/pip-build-env-p0dpn5al/overlay/lib/python3.6/site-packages/setuptools/", line 268, in run_setup
    File "/tmp/pip-build-env-p0dpn5al/overlay/lib/python3.6/site-packages/setuptools/", line 158, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "", line 532, in <module>
    File "", line 306, in main
    File "/tmp/pip-build-env-p0dpn5al/overlay/lib/python3.6/site-packages/skbuild/", line 683, in setup
    File "", line 445, in _classify_installed_files_override
      raise Exception("Not found: '%s'" % relpath_re)
  Exception: Not found: 'python/cv2/py.typed'
  ERROR: Failed building wheel for opencv-python
Failed to build opencv-python
ERROR: Could not build wheels for opencv-python which use PEP 517 and cannot be installed directly

Can someone please assist me in resolving this issue :pray:

Here’s my system:

OS: Kubuntu 23.04 x86_64 
Kernel: 6.2.0-26-generic 
Shell: bash 5.2.15 
Terminal: konsole 
CPU: 12th Gen Intel i5-12400 (12) @ 5.600GHz 
GPU: Intel Alder Lake-S GT1 [UHD Graphics 730] 
GPU: NVIDIA GeForce GTX 750 Ti 
Memory: 7312MiB / 15718MiB 
1 Like

Getting same issue. Any resolution found for this?

same issue. Were any of you able to figure it out?

there is an official pypi opencv release

please use that instead of whatever conda tries …

Faced the same issue, this worked for me: pip install opencv-python==

1 Like

the offical docs said the newest opencv is not support python 3.6.x ,check your opencv’s version

Your response was very helpful, thank you! :smile: