问题描述
我正在使用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?
(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版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!