【发布时间】:2025-12-18 14:30:01
【问题描述】:
我正在使用 Windows Server 2012 R2 和 Python 2.7,确切地说:
Python 2.7.15(v2.7.15:ca079a3ea3,2018 年 4 月 30 日,16:22:17)[MSC v.1500 32位(英特尔)]在win32上
最新版本的 OpenCV 库 3.4.2 无法正常工作,并产生以下错误:
>>> import cv2
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import cv2
File "C:\Python27\lib\site-packages\cv2\__init__.py", line 3, in <module>
from .cv2 import *
ImportError: DLL load failed: The specified module could not be found.
所以我下载了旧版本的 OpenCV 3.4.1,将 cv2.pyd 复制到 C:/Python27/lib/site-packages 并且 viola 它工作正常!
现在这是我的失败还是他们的失败?我下载了 VC++ x86 Redistributable 2015 和 2017,Python 也是 32 位的,而且我使用的是 32 位版本的 OpenCV lib,所以我认为这不是我的问题,这是怎么回事,有人知道吗?
【问题讨论】: