opencv-python icon indicating copy to clipboard operation
opencv-python copied to clipboard

please help me, how can fix this in jupyter import cv2 ..................its work well in python but in jupyter not

Open alirezahamd254 opened this issue 9 months ago • 3 comments

Expected behaviour

run cv2 Write here how did you expect the library to function. cv2

Actual behaviour

Write here what went wrong.

Steps to reproduce

  • example code
  • operating system
  • architecture (e.g. x86)
  • opencv-python version
Issue submission checklist

(((((error : ~\anaconda3\lib\site-packages\cv2_init_.py in 179 180 --> 181 bootstrap() ~\anaconda3\lib\site-packages\cv2_init_.py in bootstrap() 173 174 for submodule in __collect_extra_submodules(DEBUG): --> 175 if _load_extra_py_code_for_module("cv2", submodule, DEBUG): 176 if DEBUG: print("Extra Python code for", submodule, "is loaded") 177 ~\anaconda3\lib\site-packages\cv2_init.py in _load_extra_py_code_for_module(base, name, enable_debug_print) 26 native_module = sys.modules.pop(module_name, None) 27 try: ---> 28 py_module = importlib.import_module(module_name) 29 except ImportError as err: 30 if enable_debug_print: ~\anaconda3\lib\importlib_init.py in import_module(name, package) 125 break 126 level += 1 --> 127 return _bootstrap.gcd_import(name[level:], package, level) 128 129 ~\anaconda3\lib\site-packages\cv2\typing_init.py in 67 68 if numpy.lib.NumpyVersion(numpy.version) > "1.20.0" and sys.version_info >= (3, 9): ---> 69 NumPyArrayGeneric = numpy.ndarray[typing.Any, numpy.dtype[numpy.generic]] 70 else: 71 NumPyArrayGeneric = numpy.ndarray TypeError: 'numpy._DTypeMeta' object is not subscriptable

  • [ ] 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

alirezahamd254 avatar Nov 24 '23 03:11 alirezahamd254

Look at pinned issue: https://github.com/opencv/opencv-python/issues/885

Avasam avatar Nov 24 '23 04:11 Avasam

Uploading Screenshot 2023-11-24 093143.png…

alirezahamd254 avatar Nov 24 '23 06:11 alirezahamd254

@alirezahamd254, have you tried updating your NumPy version? More information about the libraries in your environment would be useful.

PavloFesenko avatar Nov 26 '23 16:11 PavloFesenko