Can't import openCV in anaconda Python 3.10

Viewed 37

I installed openCV onto Python 3.10 and it's erroring in the import stage.

Any ideas on what to try for this?

>>> import cv2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\ProgramData\Anaconda3\envs\myenv\lib\site-packages\cv2\__init__.py", line 181, in <module>
    bootstrap()
  File "C:\ProgramData\Anaconda3\envs\myenv\lib\site-packages\cv2\__init__.py", line 153, in bootstrap
    native_module = importlib.import_module("cv2")
  File "C:\ProgramData\Anaconda3\envs\myenv\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: DLL load failed while importing cv2: The specified module could not be found.

>>> ^Z


(myenv) C:\Users\Eli Rogers>python -V
Python 3.10.6
1 Answers

Here you are getting error because the interpreter has already started and when you have retype the python it is interpreting it as a variable so .

you can check out this : NameError: name 'python' is not defined

where the same problem has discussed

Related