在python3中导入opencv时,有人可以帮我解决错误吗?
当我在python3中导入cv2时,我得到类似
的东西Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-
packages/cv2/__init__.py", line 4, in <module>
from .cv2 import *
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/cv2/cv2.cpython-36m-darwin.so, 2):
Symbol not found: _clock_gettime
Referenced from: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/cv2/.dylibs/libavutil.55.78.100.dylib
(which was built for Mac OS X 10.12)
Expected in: /usr/lib/libSystem.B.dylib
in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/cv2/.dylibs/libavutil.55.78.100.dylib
另外,我使用的是python版本3.6.3
答案 0 :(得分:2)
如果您不想升级您的操作系统,可以安装早期版本的opencv:
pip install opencv-python==3.3.0.10
答案 1 :(得分:1)
clock_gettime()。它在错误消息中这样说。
根据我的理解,可能可以针对早期的Xcode SDK构建,但最简单的可能是升级到Mac的最新操作系统。