ImportError: ERROR: recursion is detected during loading of "cv2" binary extensions. Check OpenCV installation.

Open
#680 23 comments 5 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

Assessment

This issue has not been assessed yet.

Description

duplicate

Seeing a similar issue to https://github.com/opencv/opencv-python/issues/432 with opencv-python==4.6.0.66 packaged using pyinstaller==4.4. It works fine when running from source; the issue only occurs when packaged. opencv-python==4.5.5.64 works fine.

My Env:
Ubuntu 16
Python3.8
opencv-python==4.6.0.66
pyinstaller==4.4

Traceback (most recent call last):
  File "ftf_app_bambam.py", line 2, in <module>
  File "PyInstaller/loader/pyimod03_importers.py", line 546, in exec_module
  File "taskmaster/app_manager.py", line 30, in <module>
  File "PyInstaller/loader/pyimod03_importers.py", line 546, in exec_module
  File "hardware/ximea_camera/setup_tools/filter_tuning.py", line 9, in <module>
  File "PyInstaller/loader/pyimod03_importers.py", line 546, in exec_module
  File "cv2/__init__.py", line 181, in <module>
    bootstrap()
  File "cv2/__init__.py", line 153, in bootstrap
    native_module = importlib.import_module("cv2")
  File "importlib/__init__.py", line 127, in import_module
    applySysPathWorkaround = True
  File "PyInstaller/loader/pyimod03_importers.py", line 546, in exec_module
  File "cv2/__init__.py", line 181, in <module>
    bootstrap()
  File "cv2/__init__.py", line 76, in bootstrap
    raise ImportError('ERROR: recursion is detected during loading of "cv2" binary extensions. Check OpenCV installation.')
ImportError: ERROR: recursion is detected during loading of "cv2" binary extensions. Check OpenCV installation.
[11606] Failed to execute script 'ftf_app_bambam' due to unhandled exception!
Dominant language
Python
Stars
5.4k
Forks
1k
Avg merge
22h 17m
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from opencv/opencv-python

All issues in opencv/opencv-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.