gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 03:24:45 26 4
gpt4 key购买 nike

我使用的是 macOS Mojave 10.14.6。我的Qt版本是5.13.1。我的 Qt Creator 版本是 4.10.0。

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

因此,据我所知,lldb 使用了错误的 python 版本。这是 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"})

(lldb) script 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 ^

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

最佳答案

作为快速修复,请在终端中运行此命令:

defaults write com.apple.dt.lldb DefaultPythonVersion 2

问题是 lldb 的默认版本现在是 Python 3。这导致了 Qt 的一些问题,希望很快就能得到解决:

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

关于python - Qt 调试器在 mac 上使用错误的 python 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58053623/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com