找不到python Interpreter - Opencv cmake错误

时间:2017-09-30 08:00:03

标签: python python-3.x opencv ubuntu ubuntu-14.04

我正在使用Ubuntu 14.04并尝试安装opencv 3.3.0。当我执行cmake获取make文件时,它无法找到Python解释器,显示以下消息(虽然cmake继续)

    -- Could NOT find PythonInterp: Found unsuitable version "2.7.6", 
       but required is at least "3.4" (found /usr/bin/python)
    -- Could NOT find PythonInterp: Found unsuitable version "2.7.6", 
       but required is at least "3.2" (found /usr/bin/python)

当我检查 / usr / bin / 时,我可以在那里看到python库/二进制文件(见下图)

enter image description here

我还可以看到以下版本的python

 python             python2.7-config   python3.4          python3.4m-
 config  python3.5m-config  python3m-config    
 python2            python2-config     python3.4-config   python3.5          
 python3-config     python-config      
 python2.7          python3            python3.4m         python3.5m         
 python3m           python-mkdebian  

我该如何解决这个问题?由于这个问题,我无法在我的python脚本中使用 cv2 ,因为它会抛出以下错误

    ImportError: No module named 'cv2'

1 个答案:

答案 0 :(得分:0)

解决此问题的最简单方法是使用AnacondaMiniconda。您可以通过opencv轻松安装conda install -c conda-forge opencv

另一种方法是将/usr/bin/python/usr/bin/python3.4相关联。不建议这样做。