Qt调试器在Mac上使用错误的python版本 [英] Qt Debugger using wrong python version on mac

查看:284
本文介绍了Qt调试器在Mac上使用错误的python版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用macOS Mojave 10.14.6.我的Qt版本是5.13.1.我的Qt Creator版本是4.10.0.

I'm on macOS Mojave 10.14.6. My Qt version is 5.13.1. My Qt Creator version is 4.10.0.

当我设置一个断点并运行应用程序时,调试器将永远不会完成并打印到调试器日志中,并显示以下错误.

When I set a breakpoint and run the application, the debugger never finishes and prints to the debugger log with the below error.

据我所知,使用了错误版本的lldb python.这是Qt Creator设置还是mac设置,我该如何解决?

So, the wrong version of python for lldb is being used, from what I can gather. Is this a Qt Creator setting or a mac setting and how can I fix it?

dCALL:安装引擎 d启动LLDB:/usr/bin/lldb 设置下级... < 1loadDumpers({"token":1}) < 2executeDebuggerCommand({"command":设置附加target.source-map/Users/qt/work/qt/usr/local/Cellar/qt/5.13.1/../Src",令牌":2} ) < 3setupInferior({"attachpid":0,"breakonmain":0," executable:"/Users/kyle/GoogleDrive/programming/MasteringQt5/Chapter02/build-Sysinfo-Desktop-Debug/Sysinfo.app/Contents/MacOS/Sysinfo," nativemixed:0," platform:"," processargs:"," remotechannel:"," startmode:1," sysroot:"," token:3 ,"useterminal":0,工作目录":"/Users/kyle/GoogleDrive/programming/MasteringQt5/Chapter02/build-Sysinfo-Desktop-Debug/Sysinfo.app/Contents/MacOS"})

dCALL: SETUP ENGINE dSTARTING LLDB: /usr/bin/lldb Setting up inferior... <1loadDumpers({"token":1}) <2executeDebuggerCommand({"command":"settings append target.source-map /Users/qt/work/qt /usr/local/Cellar/qt/5.13.1/../Src","token":2}) <3setupInferior({"attachpid":0,"breakonmain":0,,"executable":"/Users/kyle/GoogleDrive/programming/MasteringQt5/Chapter02/build-Sysinfo-Desktop-Debug/Sysinfo.app/Contents/MacOS/Sysinfo","nativemixed":0,"platform":"","processargs":"","remotechannel":"","startmode":1,"sysroot":"","token":3,"useterminal":0,"workingdirectory":"/Users/kyle/GoogleDrive/programming/MasteringQt5/Chapter02/build-Sysinfo-Desktop-Debug/Sysinfo.app/Contents/MacOS"})

(lldb)脚本sys.path.insert(1,'/Applications/Qt Creator.app/Contents/Resources/debugger/')

(lldb) script sys.path.insert(1, '/Applications/Qt Creator.app/Contents/Resources/debugger/')

(lldb)脚本* 追溯(最近一次通话): 文件",第1行,在 文件"/Applications/Qt Creator.app/Contents/Resources/debugger/lldbbridge.py",第1912行 列印讯息 ^

(lldb) script from lldbbridge import * Traceback (most recent call last): File "", line 1, in File "/Applications/Qt Creator.app/Contents/Resources/debugger/lldbbridge.py", line 1912 print message ^

SyntaxError:对"print"的调用中缺少括号.你是说打印(消息)吗?

SyntaxError: Missing parentheses in call to 'print'. Did you mean print(message)?

推荐答案

作为快速解决方案,请在终端中运行此程序:

As a quick fix, run this in terminal:

默认设置为com.apple.dt.lldb DefaultPythonVersion 2

defaults write com.apple.dt.lldb DefaultPythonVersion 2

问题是lldb的默认版本现在是Python3.这导致Qt出现了一些问题,希望很快能解决:

The problem is the lldb's default version is now Python 3. This is causing some issues with Qt that will hopefully get resolved soon:

https://bugreports.qt.io/browse/QTCREATORBUG-22955

这篇关于Qt调试器在Mac上使用错误的python版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆