【问题标题】:Cannot find CV2 Module -- Cannot find PythonLibs on openCV build?找不到 CV2 模块 -- 在 openCV 构建中找不到 PythonLibs?
【发布时间】:2015-11-17 23:53:55
【问题描述】:

我正在尝试在 Python 3.4.3 中运行转储程序脚本。这是一个经过测试的有效脚本,但我说ImportError: No Module named 'cv2'

失败了

我认为这可能是由于 openCV 3.0.0 没有构建 python 绑定,但我不确定。当我在 build_binary 目录中运行 cmake ./ 时,它会为我提供这些输出(从大量输出中选择):

-- Found PythonInterp: /usr/local/bin/python2.7 (found suitable version "2.7.9", minimum required is "2.7") 
-- Could NOT find PythonLibs (missing:  PYTHON_INCLUDE_DIRS) (found suitable exact version "2.7.9")
-- Found PythonInterp: /usr/bin/python3.4 (found suitable version "3.4.3", minimum required is "3.4") 
-- Found apache ant 1.9.3: /usr/bin/ant

后来它给出了:

--   Python 2:
--     Interpreter:                 /usr/local/bin/python2.7 (ver 2.7.9)
-- 
--   Python 3:
--     Interpreter:                 /usr/bin/python3.4 (ver 3.4.3)
-- 
--   Python (for build):            /usr/local/bin/python2.7
-- 

任何想法为什么它找不到我的 python 库?我们是否认为问题在于它没有构建 python 部分?

【问题讨论】:

    标签: python opencv python-3.x cmake


    【解决方案1】:

    看起来this 之前已经在 SO 中处理过。如果您有任何机会之前检查过此链接,但它对解决您的问题没有帮助,我发现了一些其他有用的链接:

    【讨论】:

      猜你喜欢
      • 2018-12-30
      • 1970-01-01
      • 2013-11-21
      • 2018-12-20
      • 1970-01-01
      • 1970-01-01
      • 2017-11-19
      • 2020-06-22
      相关资源
      最近更新 更多