Python与Q结合使用时崩溃

2024-10-01 13:38:32 发布

您现在位置:Python中文网/ 问答频道 /正文

我遵循this basic tutorial让Python打开在Qt设计器中设计的窗口。但是,代码不会产生预期的结果,并且会崩溃

-[QNSApplication _setup:]: unrecognized selector sent to instance

完整的错误看起来像this
在google上搜索这个错误,我发现它在某些与Python相关的包(如Spyder和py27-opengl)中是a bug,但是port installed | grep py显示我没有any of those packages(至少我没有看到任何提到Spyder或opengl)。 当我在终端中键入python时,它显示以下版本:

Python 2.7.8 (default, Jul 13 2014, 02:29:54) 

这似乎是最新版本,因为运行port upgrade outdated不会安装新版本。 这个错误的原因是什么?我该如何解决?你知道吗


Tags: 代码版本basicport错误setupthisqt