【问题标题】:Python Import cv2 error in jupyter works on mac terminaljupyter中的Python Import cv2错误适用于mac终端
【发布时间】:2016-11-05 20:05:44
【问题描述】:

我在 在 jupyter notebook 上导入 cv2 时遇到了困难。但是,当我输入时:

import cv2 

在mac终端没有错误。

我引用了post 1 来确定 jupyter notebook 指的是 python3.5 文件路径,而作为导入工作正常的 mac 终端指的是 python 2.7 文件路径。

我在 jupyter notebook 中输入了post 2 中引用的以下内容以解决问题,但我仍然收到错误:

import sys
sys.path.append('/usr/local/lib/python2.7/site-packages')
import cv2

非常感谢任何帮助!

【问题讨论】:

    标签: python macos opencv


    【解决方案1】:

    我认为你不能在 python 3.5 中使用 python 2.7 的模块,所以你必须在你的 python3 环境中安装 cv2 或者让 jupyter 使用 python2

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-06-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-24
      • 1970-01-01
      • 2014-11-20
      • 1970-01-01
      相关资源
      最近更新 更多