ImportError: DLL load failed while importing cv2: %1 不是有效的 Win32 应用程序。已解决

C:\Anaconda3\envs\yolov5\python.exe E:/yolov5/yolov5-master/detect.py
Traceback (most recent call last):
  File "E:/yolov5/yolov5-master/detect.py", line 14, in <module>
    import cv2
  File "C:\Anaconda3\envs\yolov5\lib\site-packages\cv2\__init__.py", line 3, in <module>
    from .cv2 import *
ImportError: DLL load failed while importing cv2: %1 不是有效的 Win32 应用程序。

Process finished with exit code 1

实在没办法的办法,试了各种方法,绞尽脑汁,仍然是这个错误,所以想到最近windows更新过,会不会是系统更新导致的?
于是选择系统还原,至于如何还原,大家百度一下哈,完美解决

C:\Users\Administrator\Desktop\win10>python
Python 3.9.7 (default, Sep 16 2021, 16:59:28) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32

Warning:
This Python interpreter is in a conda environment, but the environment has
not been activated.  Libraries may fail to load.  To activate this environment
please see https://conda.io/activation

Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> print(cv2.__version__)

你可能感兴趣的:(机器学习,深度学习,人工智能)