OpenCV python version: 4.8.0.74
Operating System / Platform: Mac OS X 14.4.1 (23E224)
Python version: 3.10.14
Detailed description
I attempt to import cv2 in my code and I face the following error:
Traceback (most recent call last):
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevconsole.py", line 364, in runcode
coro = func()
File "<input>", line 1, in <module>
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/opt/anaconda3/envs/TableExtraction/lib/python3.10/site-packages/cv2/__init__.py", line 181, in <module>
bootstrap()
File "/opt/anaconda3/envs/TableExtraction/lib/python3.10/site-packages/cv2/__init__.py", line 175, in bootstrap
if __load_extra_py_code_for_module("cv2", submodule, DEBUG):
File "/opt/anaconda3/envs/TableExtraction/lib/python3.10/site-packages/cv2/__init__.py", line 28, in __load_extra_py_code_for_module
py_module = importlib.import_module(module_name)
File "/opt/anaconda3/envs/TableExtraction/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/opt/anaconda3/envs/TableExtraction/lib/python3.10/site-packages/cv2/typing/__init__.py", line 168, in <module>
LayerId = cv2.dnn.DictValue
AttributeError: module 'cv2.dnn' has no attribute 'DictValue'
I have attempted to reinstall cv2 in a different conda environment to no avail.
Steps to reproduce
Literally, just:
import cv2
Issue submission checklist
[X] I report the issue, it's not a question
[X] I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
[X] I updated to the latest OpenCV version and the issue is still there
[X] There is reproducer code and related data files (videos, images, onnx, etc)
I have also attempted to use OpenCV 4.9.0.80 - the reason behind using an earlier version was a few dependencies on the earlier version of OpenCV. However, the issue persists with the updated OpenCV.
System Information
OpenCV python version: 4.8.0.74 Operating System / Platform: Mac OS X 14.4.1 (23E224) Python version: 3.10.14
Detailed description
I attempt to import cv2 in my code and I face the following error:
I have attempted to reinstall cv2 in a different conda environment to no avail.
Steps to reproduce
Literally, just:
Issue submission checklist