0

I'm attempting to us pygame 1.9.2 with Python 3.4.3, and it is giving me an error I don't understand at all. The code is a basic hello world:

import sys
import pygame
from pygame.locals import *

pygame.init()
DISPLAYSURF = pygame.display.set_mode((400, 300))
pygame.display.set_caption('Hello World!')

while True:
    for event in pygame.event.get():
        if event.type == QUIT:
            pygame.quit()
            sys.exit()
    pygame.display.update()

Here's the error I'm getting:

2015-03-16 22:41:23.073 Python[71068:8424090] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Error (1000) creating CGSWindow on line 281'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff8c69364c __exceptionPreprocess + 172
    1   libobjc.A.dylib                     0x00007fff93ede6de objc_exception_throw + 43
    2   CoreFoundation                      0x00007fff8c6934fd +[NSException raise:format:] + 205
    3   AppKit                              0x00007fff8a1769dd _NSCreateWindowWithOpaqueShape2 + 1417
    4   AppKit                              0x00007fff8a174d3c -[NSWindow _commonAwake] + 1808
    5   AppKit                              0x00007fff8a082ee0 -[NSWindow _commonInitFrame:styleMask:backing:defer:] + 864
    6   AppKit                              0x00007fff8a08254c -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 1477
    7   AppKit                              0x00007fff8a081f7a -[NSWindow initWithContentRect:styleMask:backing:defer:] + 45
    8   libSDL-1.2.0.dylib                  0x00000001020af0f4 -[SDL_QuartzWindow initWithContentRect:styleMask:backing:defer:] + 279
    9   libSDL-1.2.0.dylib                  0x00000001020aca6a QZ_SetVideoMode + 1172
    10  libSDL-1.2.0.dylib                  0x00000001020a3dfa SDL_SetVideoMode + 907
    11  display.so                          0x0000000102108667 set_mode + 263
    12  Python                              0x00000001000e4745 PyEval_EvalFrameEx + 29589
    13  Python                              0x00000001000e604d PyEval_EvalCodeEx + 2349
    14  Python                              0x00000001000e610f PyEval_EvalCode + 63
    15  Python                              0x000000010011064e PyRun_FileExFlags + 206
    16  Python                              0x00000001001109fd PyRun_SimpleFileExFlags + 717
    17  Python                              0x00000001001281be Py_Main + 3262
    18  Python                              0x0000000100000e32 Python + 3634
    19  Python                              0x0000000100000c84 Python + 3204
)
libc++abi.dylib: terminating with uncaught exception of type NSException
  • 32 bit python and pygame or 64 bit? Which python version are you using? python.org or homebrew or macports or ? It appears you're on a mac ? – lxx Mar 17 '15 at 03:01
  • 64 bit. Python 3.4.2, i think I wrote it wrong in the original post. Python,org's version. Yes, I am on mac. – cameronstowell Mar 17 '15 at 03:08
  • tried running it as sudo ? sudo python3 hello.py does that give the same error ? – lxx Mar 17 '15 at 03:56

0 Answers0