python - Pygame not working on Mac when calling 'pygame.display.set_mode' -


i have tried long time solve problem, found similar topics in stackoverflow, nothing me.

i'm trying install pygame on macbook pro os x 10.9.4: installation went fine, it’s enough me digit on terminal following lines receive error:

>>>import pygame  >>>pygame.init()    (6,0)  >>>pygame.display.set_mode((640, 480)) 

the error following:

* terminating app due uncaught exception 'nsinternalinconsistencyexception', reason: 'error (1000) creating cgswindow on line 263' * first throw call stack:

(     0   corefoundation                      0x00007fff929eb25c __exceptionpreprocess + 172     1   libobjc.a.dylib                     0x00007fff94491e75 objc_exception_throw + 43     2   corefoundation                      0x00007fff929eb10c +[nsexception raise:format:] + 204     3   appkit                              0x00007fff8b20ce95 _nscreatewindowwithopaqueshape2 + 1403     4   appkit                              0x00007fff8b20ba21 -[nswindow _commonawake] + 3720     5   appkit                              0x00007fff8b0e7400 -[nswindow _commoninitframe:stylemask:backing:defer:] + 882     6   appkit                              0x00007fff8b0e6882 -[nswindow _initcontent:stylemask:backing:defer:contentview:] + 1054     7   appkit                              0x00007fff8b0e6458 -[nswindow initwithcontentrect:stylemask:backing:defer:] + 45     8   libsdl-1.2.0.dylib                  0x0000000102a2e21e -[sdl_quartzwindow initwithcontentrect:stylemask:backing:defer:] + 279     9   libsdl-1.2.0.dylib                  0x0000000102a2bc63 qz_setvideomode + 1417     10  libsdl-1.2.0.dylib                  0x0000000102a22f71 sdl_setvideomode + 906     11  display.so                          0x0000000102a71317 set_mode + 263     12  python                              0x00000001000c2f7d pyeval_evalframeex + 21485     13  python                              0x00000001000c4f93 pyeval_evalcodeex + 2115     14  python                              0x00000001000c50b6 pyeval_evalcode + 54     15  python                              0x00000001000e946c pyrun_interactiveoneflags + 380     16  python                              0x00000001000e96ce pyrun_interactiveloopflags + 78     17  python                              0x00000001000e9ee1 pyrun_anyfileexflags + 161     18  python                              0x0000000100100bfd py_main + 3101     19  python                              0x0000000100000f14 python + 3860     20  ???                                 0x0000000000000001 0x0 + 1 ) 

libc++abi.dylib: terminating uncaught exception of type nsexception abort trap: 6

i’m aware must sdl (that installed properly). followed suggestion made in similar post add line

>>> os.environ['sdl_videodriver']= ‘x11' 

i same error. if write same line ‘quartz’ (the mac video driver) same. tried link should have fixed sdl problem didn’t work—> http://www.noquarterarcade.com/xcode-sdl-development-setup , other similar. searched lot in internet couldn’t find match problem! able use pygame on mac , not on old linux computer! thank lot!

i managed fix problem following these instructions: (working latest versions 10.9 , 10.10 of osx)

1 )create , add following ~/.bash_profile:

# homebrew binaries take precedence on apple defaults export path=/usr/local/bin:$path 

2)install apple xcode command line tools: xcode-select --install

3)install xquartz

4)install homebrew: ruby -e "$(curl -fssl https://raw.github.com/homebrew/homebrew/go/install)"

5)install python3 "proper" , packages we’ll need installing pygame bitbucket: brew install python3 hg sdl sdl_image sdl_mixer sdl_ttf portmidi

6)install pygame: pip3 install hg+http://bitbucket.org/pygame/pygame

7)restart mac xquartz changes

i post in case else has same problem , read post!! hope can useful!


Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -