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

Traceback TypeError for any dvr-scan command #143

Closed
jgurling opened this issue Sep 14, 2023 · 1 comment
Closed

Traceback TypeError for any dvr-scan command #143

jgurling opened this issue Sep 14, 2023 · 1 comment

Comments

@jgurling
Copy link

I'm running Ubuntu 22.04, Python 3.10.12. I installed dvr-scan via pip install dvr-scan[opencv]. Seemingly no issues during install. Now, no matter what dvr-scan command I run, e.g.

dvr-scan --help

I get the same Traceback error:

Traceback (most recent call last):
  File "/home/james/.local/bin/dvr-scan", line 5, in <module>
    from dvr_scan.__main__ import main
  File "/home/james/.local/lib/python3.10/site-packages/dvr_scan/__init__.py", line 41, in <module>
    import dvr_scan.opencv_loader as _
  File "/home/james/.local/lib/python3.10/site-packages/dvr_scan/opencv_loader.py", line 34, in <module>
    import cv2 as _
  File "/home/james/.local/lib/python3.10/site-packages/cv2/__init__.py", line 181, in <module>
    bootstrap()
  File "/home/james/.local/lib/python3.10/site-packages/cv2/__init__.py", line 175, in bootstrap
    if __load_extra_py_code_for_module("cv2", submodule, DEBUG):
  File "/home/james/.local/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 "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/home/james/.local/lib/python3.10/site-packages/cv2/typing/__init__.py", line 69, in <module>
    NumPyArrayGeneric = numpy.ndarray[typing.Any, numpy.dtype[numpy.generic]]
TypeError: 'numpy._DTypeMeta' object is not subscriptable

I'm unskilled in this. I'm not sure if this is some issue with importing cv2 package. I see from this issue that there might be some issue with package names (cv2 vs opencv-python vs opencv-contrib-python) so I tried pip install opencv-contrib-python but no change with the issue

Any ideas? TIA.

@jgurling
Copy link
Author

Ahh, I came across this recent issue with opencv, tried the suggested single-quotes workaround in __init__.py file and seems to be working now! So, I think there's still an issue with opencv whose fix hasn't been released yet, but seems like this isn't an issue with dvr-scan.

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

1 participant