CMake配置OpenCV时,显示错误:find_host_package(PythonInterp 2.7)' found wrong Python version

155 篇文章 26 订阅
82 篇文章 20 订阅

CMake配置OpenCV时,显示错误:find_host_package(PythonInterp 2.7)' found wrong Python version

问题描述:

CMake配置OpenCV时,显示错误:find_host_package(PythonInterp 2.7)' found wrong Python version,具体提示如下:

Found PythonInterp: C:/Users/LiuBing/AppData/Local/Programs/Python/Python38/python.exe (found suitable version "3.8.2", minimum required is "2.7")

CMake Warning at cmake/OpenCVDetectPython.cmake:81 (message):

  CMake's 'find_host_package(PythonInterp 2.7)' found wrong Python version:

 

  PYTHON_EXECUTABLE=C:/Users/LiuBing/AppData/Local/Programs/Python/Python38/python.exe

  PYTHON_VERSION_STRING=3.8.2

  Consider providing the 'PYTHON2_EXECUTABLE' variable via CMake command line

  or environment variables

Call Stack (most recent call first):

  cmake/OpenCVDetectPython.cmake:271 (find_python)

  CMakeLists.txt:598 (include)

解决方案:

桌面“计算机”右键选择“属性”,在弹出“系统”窗口左侧选择“高级系统设置”,弹出“系统属性窗口”。

依次选择“系统属性”>>>“高级”>>>“环境变量”,弹出“环境变量”窗口。

“系统变量”栏选择“新建”,按下图操作:

设置完毕后,重启电脑。

  • 5
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值