gpt4 book ai didi

导入cv2时出现python importError

转载 作者:太空狗 更新时间:2023-10-30 02:18:16 27 4
gpt4 key购买 nike

我已经使用 brew 安装了 opencv3,但是在执行 import cv2 时遇到了 importError

>>> import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>

ImportError: dlopen(/usr/local/lib/python2.7/site-packages/cv2.so, 2): Library not loaded: /usr/local/opt/libpng/lib/libpng16.16.dylib

Referenced from: /usr/local/Cellar/opencv/2.4.12_2/lib/libopencv_highgui.2.4.dylib
Reason: Incompatible library version: libopencv_highgui.2.4.dylib requires version 37.0.0 or later, but libpng16.16.dylib provides version 35.0.0

有人可以帮忙吗?

最佳答案

以下解决了问题。

brew uninstall --force brew-cask
brew uninstall --force opencv
brew doctor
brew tap homebrew/science
brew install opencv

关于导入cv2时出现python importError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36409553/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com