[visionegg] Re: [VisionEgg]: macosx module in pygame not available

Mark Tovey wrote:

Hi Andrew,

I thought I had this problem beat, but for some reason it came back again.
I've mysteriously lost the ability to turn off the menu bar with two
screens, because I no longer seem to be able to access the macosx module in
pygame.


The error I get is the following:

File "controlprotocol2.py", line 65, in ?
  pygame.macosx.app.mainMenu().setMenuBarVisible_(False)
AttributeError: 'module' object has no attribute 'macosx'
warning: use func(*args, **kwargs) instead of apply(func, args, kwargs)

Hi Mark,


Does it help to do "import pygame.macosx" before the line in question?

If that doesn't help we might have to prevail upon outside help -- pygame on OS X now uses PyObjC, which is extremely powerful and also extremely uncharted territory for me. There is a conditional in pygame/__init__.py that depends on something from AppKit before it imports macosx. (Perhaps upgrading your version of PyObjC caused this behavior??)

If that doesn't fix it, you or I can get in touch with Bob Ippolito, the (again) de-facto maintainer of pygame on OS X. He seems to be much more PyObjC-saavy than I am.

One last thing: if you're running from the command line, make sure you use "pythonw".

Cheers!
Andrew

Other related posts: