PYGAME:错误:由于未捕获的异常“nsInternalInconsistencException”终止应用程序,原因:“在第259行创建CGSWindow时出错(1000)

2024-05-29 00:11:47 发布

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

这是我关于堆栈溢出的第一篇文章。我一直在尝试在我的MAC Mountain Lion上运行pygame代码,在成功安装pygame之后,我尝试使用命令为显示设置_模式

在pygame.display.set_模式([700400])

我得到以下错误

2013-12-19 18:31:12.299 Python[25975:f0b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Error (1000) creating CGSWindow on line 259'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff86c7bb06 __exceptionPreprocess + 198
    1   libobjc.A.dylib                     0x00007fff8aab93f0 objc_exception_throw + 43
    2   CoreFoundation                      0x00007fff86c7b8dc +[NSException raise:format:] + 204
    3   AppKit                              0x00007fff88231b49 _NSCreateWindowWithOpaqueShape2 + 655
    4   AppKit                              0x00007fff88230340 -[NSWindow _commonAwake] + 2002
    5   AppKit                              0x00007fff881eed82 -[NSWindow _commonInitFrame:styleMask:backing:defer:] + 1763
    6   AppKit                              0x00007fff881edecf -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 1568
    7   AppKit                              0x00007fff881ed89f -[NSWindow initWithContentRect:styleMask:backing:defer:] + 45
    8   libSDL-1.2.0.dylib                  0x000000010054b9cd -[SDL_QuartzWindow initWithContentRect:styleMask:backing:defer:] + 265
    9   libSDL-1.2.0.dylib                  0x000000010054943d QZ_SetVideoMode + 1423
    10  libSDL-1.2.0.dylib                  0x000000010054069c SDL_SetVideoMode + 936
    11  display.so                          0x00000001005c330f set_mode + 271
    12  Python                              0x00000001000c277d PyEval_EvalFrameEx + 21405
    13  Python                              0x00000001000c4786 PyEval_EvalCodeEx + 2118
    14  Python                              0x00000001000c48a6 PyEval_EvalCode + 54
    15  Python                              0x00000001000e912e PyRun_FileExFlags + 174
    16  Python                              0x00000001000e93ca PyRun_SimpleFileExFlags + 458
    17  Python                              0x000000010010044d Py_Main + 3101
    18  Python                              0x0000000100000f14 Python + 3860
)
libc++abi.dylib: terminate called throwing an exception
[Finished in 1.9s with exit code -6]
[shell_cmd: python -u "/Users/krutirag/Documents/Coding/Python/GameDev/Main.py"]
[dir: /Users/krutirag/Documents/Coding/Python/GameDev]
[path: /usr/bin:/bin:/usr/sbin:/sbin]

我用brew安装了python和pygame。我广泛地寻找解决办法,但没有找到任何有用的错误。感谢您的任何建议或帮助。(我在stackOverflow中发现了一个类似的问题,但我不能对此发表评论,因为我是新来的论坛,没有这个问题的要点)

谢谢。在


Tags: 错误displayexception模式pygamedeferthrowset

热门问题