-1

I have an issue with OpenCV in windows 10. Whenever I try to import OpenCV I get following error.

import cv2
 ** On entry to DGEBAL parameter number  3 had an illegal value
 ** On entry to DGEHRD  parameter number  2 had an illegal value
 ** On entry to DORGHR DORGQR parameter number  2 had an illegal value
 ** On entry to DHSEQR parameter number  4 had an illegal value
Traceback (most recent call last):
  File "C:\Users\Krishhnandu\AppData\Roaming\Python\Python39\site-packages\numpy\__init__.py", line 305, in <module>
    _win_os_check()
  File "C:\Users\Krishhnandu\AppData\Roaming\Python\Python39\site-packages\numpy\__init__.py", line 302, in _win_os_check
    raise RuntimeError(msg.format(__file__)) from None
RuntimeError: The current Numpy installation ('C:\\Users\\Krishhnandu\\AppData\\Roaming\\Python\\Python39\\site-packages\\numpy\\__init__.py') fails to pass a sanity check due to a bug in the windows runtime. See this issue for more 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Krishhnandu\AppData\Local\Programs\Python\Python39\lib\site-packages\cv2\__init__.py", line 5, in <module>
    from .cv2 import *
ImportError: numpy.core.multiarray failed to import

Any help will be appreciated. Thanks.

David Buck
  • 3,752
  • 35
  • 31
  • 35

2 Answers2

0

Python 3.9 is very new you should go back to 3.86 and write this in cmd

pip install opencv
Ibrahim
  • 798
  • 6
  • 26
0

First, you can find help here: How do I install opencv using pip?

Then, try the following steps:

  1. Downgrade your current python version to python 3.8. Go there for more informations: how can I downgrade from python 3.7 to 3.6 in windows. You can also create a virtual environment with python 3.8: https://uoa-eresearch.github.io/eresearch-cookbook/recipe/2014/11/26/python-virtual-env/
  2. Type this command line in cmd: pip install opencv-python
  3. Check if opencv package is installed: python -c "import cv2"

For step 2, be sure your pip version is updated.

I hope it'll help you =)

Bk01
  • 33
  • 4