Re: Unable to create a window in Mountain Lion

365 views
Skip to first unread message

Tristam MacDonald

unread,
Jul 28, 2012, 7:49:33 PM7/28/12
to pyglet...@googlegroups.com
On Sat, Jul 28, 2012 at 6:30 AM, Scott Porter <scott.l...@gmail.com> wrote:
Hi Guys,
I've just upgraded to OSX 10.8 and installed Pyglet 1.2alpha.  I'm using the bundled Python, 2.7.2.  

Pyglet is now unable to create any windows.  The display flickers when "window = pyglet.window.Window(800,600)" is executed, and the Python icon is active in the toolbar, but no window appears.  Pyglet is still able to respond to events, receive input etc.  As far as I can tell there isn't any error being thrown.

Any thoughts?

I can confirm this behaviour. Fullscreen seems to be broken as well.

--
Tristam MacDonald

Adam Kidder

unread,
Jul 28, 2012, 9:31:50 PM7/28/12
to pyglet...@googlegroups.com
I can confirm as well - installed the latest pyglet from hg on Mountain Lion with 2.7.2.

Phillip Nguyen

unread,
Jul 28, 2012, 9:32:04 PM7/28/12
to pyglet...@googlegroups.com

It's very strange.  I've spent a few hours trying to debug this and haven't gotten anywhere.  The window seems to be created, but for some reason isn't visible.  I was able to get a window to show by using pypy (version 1.9) instead of the system python.

Scott Porter

unread,
Jul 28, 2012, 10:27:14 PM7/28/12
to pyglet...@googlegroups.com
I can also confirm that pypy is able to display a window while the system python is not.

Tristam MacDonald

unread,
Jul 28, 2012, 10:27:46 PM7/28/12
to pyglet...@googlegroups.com
On Sat, Jul 28, 2012 at 9:32 PM, Phillip Nguyen <evil.p...@gmail.com> wrote:
It's very strange.  I've spent a few hours trying to debug this and haven't gotten anywhere.  The window seems to be created, but for some reason isn't visible.  I was able to get a window to show by using pypy (version 1.9) instead of the system python.

I still have a stock copy of python 2.5 left over from Snow Leopard, and that works just fine on Mountain Lion.

The stock 2.6 and 2.7 however don't (nor their pythonw relatives).

--
Tristam MacDonald

oscar

unread,
Aug 14, 2012, 9:54:27 AM8/14/12
to pyglet...@googlegroups.com
I just tried the 1.2alpha1 on my machine with OS X 10.8, bundled Python (2.7.2), and the examples I have tried work. I've tried astraea.py and opengl.py, and they appear to work just fine. I'm running on an iMac (27-inch, Mid 2010). 

I thought I'd look at the problem with the missing windows, but since they are not missing for me, it's hard to find the problem. 

Richard Thomas

unread,
Aug 17, 2012, 8:08:49 AM8/17/12
to pyglet...@googlegroups.com
On Saturday, 28 July 2012 12:30:04 UTC+2, Scott Porter wrote:
Hi Guys,
I've just upgraded to OSX 10.8 and installed Pyglet 1.2alpha.  I'm using the bundled Python, 2.7.2.  

Pyglet is now unable to create any windows.  The display flickers when "window = pyglet.window.Window(800,600)" is executed, and the Python icon is active in the toolbar, but no window appears.  Pyglet is still able to respond to events, receive input etc.  As far as I can tell there isn't any error being thrown.

Any thoughts?

I spent a while playing with different versions of Python on my system. Here are the results.

/Library/Frameworks/.../2.7 --> PyObjC 2.3, doesn't work
/System/Library/Frameworks/.../2.7 --> PyObjC 2.3.2a0, doesn't work
/System/Library/Frameworks/.../2.6 --> PyObjC 2.3.2a0, doesn't work
/System/Library/Frameworks/.../2.5 --> PyObjC 2.2, works

I don't know enough about objc to know but could 2.3 have messed things up somehow?

Chard.

Richard Thomas

unread,
Aug 17, 2012, 8:45:05 AM8/17/12
to pyglet...@googlegroups.com
On Friday, 17 August 2012 14:08:49 UTC+2, Richard Thomas wrote:
/Library/Frameworks/.../2.7 --> PyObjC 2.3, doesn't work
/System/Library/Frameworks/.../2.7 --> PyObjC 2.3.2a0, doesn't work
/System/Library/Frameworks/.../2.6 --> PyObjC 2.3.2a0, doesn't work
/System/Library/Frameworks/.../2.5 --> PyObjC 2.2, works

I don't know enough about objc to know but could 2.3 have messed things up somehow?

Chard. 

Sorry, red herring. It seems that system Python 2.5 is 32bit and so uses Carbon.

Adam Griffiths

unread,
Sep 5, 2012, 11:55:50 PM9/5/12
to pyglet...@googlegroups.com
I've been using Python 2.7 with PyObjc 2.2 with Pyglet from head (or 1.2 alpha).
It's the only combination that's ever worked for me.
I'm able to run Pyglet on 10.7 and 10.8 without any problems.

I wrote about this here:

Adam Kidder

unread,
Sep 8, 2012, 5:53:10 PM9/8/12
to pyglet...@googlegroups.com
Confirmed - using 2.7.3 installed via pythonbrew and pylget from head this works again (10.8). I did not have to install PyObjc.

Nathan

unread,
Sep 10, 2012, 10:43:21 PM9/10/12
to pyglet...@googlegroups.com
On Sat, Sep 8, 2012 at 3:53 PM, Adam Kidder <thek...@gmail.com> wrote:
Confirmed - using 2.7.3 installed via pythonbrew and pylget from head this works again (10.8). I did not have to install PyObjc.


Crazy.  What does pythonbrew do differently that makes it work that Apple and Python.org don't?  (I tried installing 2.7.3 from Python.org -- and that didn't work either -- but installing it from pythonbrew worked).

Has anyone logged a bug with Apple or the Python folks?

~ Nathan 

Adam Griffiths

unread,
Sep 11, 2012, 2:04:19 AM9/11/12
to pyglet...@googlegroups.com
Pythonbrew is vanilla Python. I believe I've read elsewhere that Apple's system python can cause problems in some cases.

I would recommend always using pythonbrew and virtualenv anyway.
It's not good to pollute your system python, a system update will ruin all your work, or your work could ruin your system =P.

Cheers,
Adam

Nathan

unread,
Sep 11, 2012, 10:22:37 AM9/11/12
to pyglet...@googlegroups.com
On Tue, Sep 11, 2012 at 12:04 AM, Adam Griffiths <adam.lw....@gmail.com> wrote:
Pythonbrew is vanilla Python. I believe I've read elsewhere that Apple's system python can cause problems in some cases.

I would recommend always using pythonbrew and virtualenv anyway.
It's not good to pollute your system python, a system update will ruin all your work, or your work could ruin your system =P.

Cheers,
Adam


Ya, I looked at the pythonbrew source code, and it pretty much does the standard compilation steps.

The real puzzler, though, is why the binary OS X installer from Python.org exhibits the same behavior as the Apple-supplied python. (???)  Is Python.org not providing "vanilla Python"?  There may be something going on here...

During my ~6-8 hours trying to find the problem, I noticed that the following characteristics:

- Pyglet side of the event loop ran fine, including the Cocoa portion that passed through keystrokes
- Sounds worked fine, with or without AVbin decompression (both .ogg and .wav files played normally)
- Graphics-related calls all _worked_, meaning the call ran and didn't error out
(Here's where it gets really interesting)
- Cocoa put up the Application Menu once, but it was unclickable (meaning whatever loop processed menu handling didn't seem to be getting pumped)
- The window never appeared, even though all the calls to draw to it succeeded.  Again suggesting some graphics-related event loop wasn't getting pumped.

Things are soooo close to working, it just seems like with the system/Python.org python versions something is subtly different resulting in some windowing subsystem not getting pumped.  Could this be an elusive 1-line fix somewhere???

~ Nathan

Adam Griffiths

unread,
Sep 12, 2012, 2:40:35 AM9/12/12
to pyglet...@googlegroups.com
By Application menu, I assume you mean the system menu bar?
When I run applications I get 'python' with hide! and quit as options.
Remains clickable.

The window also appears for me.
I do get a 'shadow' window if I import pyglet during an interactive python session.
But creating a proper window also doesn't generate an issue for me.

pythonbrew --version
1.3

python --version
Python 2.7.3

pip search pyglet
<snip>
  INSTALLED: 1.2alpha1
  LATEST:    1.1.4
I grab pyglet from HEAD via pip




I also install:
pyobjc==2.2
numpy
cython
pil


pyobjc (doesn't show up in pip for some reason)

Try installing pyobjc==2.2, see if that fixes anything?

Richard Jones

unread,
Sep 12, 2012, 2:41:33 AM9/12/12
to pyglet...@googlegroups.com
I one of the goals of the 1.2 release was that you didn't need to
install pyobjc?


Richard
> --
> You received this message because you are subscribed to the Google Groups
> "pyglet-users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/pyglet-users/-/EwlDJIyly0MJ.
>
> To post to this group, send email to pyglet...@googlegroups.com.
> To unsubscribe from this group, send email to
> pyglet-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/pyglet-users?hl=en.

Adam Griffiths

unread,
Sep 12, 2012, 2:51:03 AM9/12/12
to pyglet...@googlegroups.com
Hmm, seems my current virtualenv doesn't have pyobjc installed.
Which is curious, as it's in my requirements.txt and I'm pretty sure I pip install -r'ed that file.

So it seems that's not it.

Glad its not a requirement anymore =)

Nathan

unread,
Sep 12, 2012, 1:39:18 PM9/12/12
to pyglet...@googlegroups.com
On Wed, Sep 12, 2012 at 12:40 AM, Adam Griffiths <adam.lw....@gmail.com> wrote:
By Application menu, I assume you mean the system menu bar?
When I run applications I get 'python' with hide! and quit as options.
Remains clickable.

Yes, that's what I mean.  I'm talking about the non-working case, though.  (System python / Python.org python)
 
Installing a custom pythonbrew python is fine for a temporary workaround for a developer, but I want the root problem found and fixed.

I've got a feeling that this issue is related to the fact that pyglet on OS X is slow and laggy compared to me running it on win32/64 and linux32/64 VMs on the same box.  Something's just not quite finished in the Cocoa port, methinks.  It's soooo close, though!

I'll keep plugging away at it, but my 15-minutes-per-day of learning Apple's Cocoa frameworks whilst simultaneously trying to trace pyglet's usage of it is slow going.  There's a lot to learn all at once.  And of course, then there's the specifics of how bridging python on Objective-C libraries works, which is complicated all on its own.

If Tristam or some other Cocoa guru could help out here, it would be much appreciated!

~ Nathan

Adam Griffiths

unread,
Sep 12, 2012, 10:40:24 PM9/12/12
to pyglet...@googlegroups.com
Am I correct in assuming this is 64-bit?

>>> import platform
>>> platform.architecture()
('64bit', '')

Only other thing I can think of.
Apart from that, I'm not sure what the difference could be.
I've kept my system quite vanilla.


Cheers,
Adam

Nathan

unread,
Sep 12, 2012, 11:19:17 PM9/12/12
to pyglet...@googlegroups.com
On Wed, Sep 12, 2012 at 8:40 PM, Adam Griffiths <adam.lw....@gmail.com> wrote:
Am I correct in assuming this is 64-bit?


Yes, all the pythons being discussed here are 64-bit.

~ Nathan 

priesen

unread,
Sep 17, 2013, 7:56:11 PM9/17/13
to pyglet...@googlegroups.com
Hi all

Is there any news on this topic OSX Mountain Lion 10.8 64bit and pyglet 1.2dev not showing any window?
I just updated to 10.8 tonight and now I regret it...because a face the same problem....

pat

Nathan

unread,
Sep 19, 2013, 1:07:11 PM9/19/13
to pyglet...@googlegroups.com
If you use the latest version of pyglet from the repository, that should work.

~ Nathan


--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users...@googlegroups.com.

To post to this group, send email to pyglet...@googlegroups.com.

"Juan J. Martínez"

unread,
Sep 19, 2013, 1:08:32 PM9/19/13
to pyglet...@googlegroups.com
On 19/09/13 18:07, Nathan wrote:
> If you use the latest version of pyglet from the repository, that should
> work.

Try this link:

http://pyglet.googlecode.com/archive/c752f6c696785a124957a6b3d025690d722df922.zip

That's the current version!

Regard,

Juan

--
jjm's home: http://www.usebox.net/jjm/
blackshell: http://blackshell.usebox.net/

priesen

unread,
Sep 23, 2013, 1:59:48 PM9/23/13
to pyglet...@googlegroups.com
Nathan and Juan,

Thanks for the fix, I pulled from the repository, now the window is back, it all works again :-)
There is some output showing up, I don't know if that's some debug output, or a kind of warning or maybe an error, I see this on my console when executing:

2013-09-23 19:54:43.700 Python[361:1307] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/r5/b_2thr2d0bq38v2v1mfqpnqw0000gn/T/org.python.python.savedState

thanks again,
patrick

Nathan

unread,
Sep 27, 2013, 6:58:13 PM9/27/13
to pyglet...@googlegroups.com
It's just a debug thing.  I spent over 10 hours trying to track it down to get rid of it, unsuccessfully.  Some others have tried as well without any luck.

Doesn't hurt anything, though, except dirtying up your terminal.

~ Natha


--
Reply all
Reply to author
Forward
0 new messages