我在使用 OpenCV2.2 和 Python2.7.1(应该兼容)时遇到了一些麻烦。我已将 OpenCV 安装到D:\OpenCV2.2PreCom\
,添加了D:\OpenCV2.2PreCom\Python2.7\Lib\site-packages
路径sys.path
以及环境变量 PYTHONPATH。
我还确保将D:\OpenCV2.2PreCom\bin
路径添加到 Path 环境变量中。但是,当我尝试通过键入“import cv”来访问cv.pyd
文件(位于 中)时,D:\OpenCV2.2PreCom\Python2.7\Lib\site-packages\
我得到一个importerror
:
IDLE 看起来像这样:
Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import sys
>>> sys.path.append('D:\OpenCV2.2PreCom\Python2.7\Lib\site-packages')
>>> import cv
Traceback (most recent call last):
File "<pyshell#64>", line 1, in <module>
import cv
ImportError: DLL load failed: The specified module could not be found.
>>>
那么我还能尝试让 Python 导入 OpenCV 吗?
亲切的问候。