简体   繁体   English

Qt 调试器在 mac 上使用错误的 python 版本

[英]Qt Debugger using wrong python version on mac

I'm on macOS Mojave 10.14.6.我在 macOS Mojave 10.14.6 上。 My Qt version is 5.13.1.我的 Qt 版本是 5.13.1。 My Qt Creator version is 4.10.0.我的 Qt Creator 版本是 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.当我设置断点并运行应用程序时,调试器永远不会完成并打印到调试器日志并显示以下错误。

So, the wrong version of python for lldb is being used, from what I can gather.因此,据我所知,正在使用 lldb 的错误版本的 python。 Is this a Qt Creator setting or a mac setting and how can I fix it?这是 Qt Creator 设置还是 mac 设置,我该如何解决?

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"}) dCALL: SETUP ENGINE dSTARTING LLDB: /usr/bin/lldb 设置低级... <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) script sys.path.insert(1, '/Applications/Qt Creator.app/Contents/Resources/debugger/') (lldb) 脚本 sys.path.insert(1, '/Applications/Qt Creator.app/Contents/Resources/debugger/')

(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 ^ (lldb) 来自 lldbbridge 导入的脚本 * Traceback(最近一次调用最后一次):文件“”,第 1 行,文件“/Applications/Qt Creator.app/Contents/Resources/debugger/lldbbridge.py”,第 1912 行打印消息 ^

SyntaxError: Missing parentheses in call to 'print'. SyntaxError:调用“打印”时缺少括号。 Did you mean print(message)?你的意思是打印(消息)?

As a quick fix, run this in terminal:作为快速修复,在终端中运行它:

defaults write com.apple.dt.lldb DefaultPythonVersion 2默认写入 com.apple.dt.lldb DefaultPythonVersion 2

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:问题是 lldb 的默认版本现在是 Python 3。这导致 Qt 出现一些问题,希望很快得到解决:

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

This is addressed in QTCREATORBUG-22955 and fixed in Qt Creator 4.10.1 .这在QTCREATORBUG-22955中得到解决,并在Qt Creator 4.10.1中得到修复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM