Pepijn's Problem

321 views
Skip to first unread message

Nathan

unread,
Dec 8, 2012, 1:31:47 AM12/8/12
to pyglet...@googlegroups.com
Pepijn,

I started a new email thread to help you debug this problem (so it won't sort together with the other thread).

It looks like you need to install a newer version of AVbin.  Either try the last release (version 10):


...or the latest prerelease (which may work better):


Try installing one of those and then run the commands again.

~ Nathan


On Fri, Dec 7, 2012 at 3:54 PM, Pepijn Gooiker <pep...@boltcreative.com> wrote:
Hey Nathan,

This is the output when i run said commands:

Python 2.7.3 (v2.7.3:70274d53c1dd, Apr  9 2012, 20:52:43)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyglet

>>> print(pyglet.version)
1.2alpha1

>>> print(pyglet.media.have_avbin)
2012-12-07 14:52:34.051 Python[414:f07] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/b6/wjplmbk94bd501nx2n40vzbr0000gn/T/org.python.python.savedState
Unexpected error loading library /usr/local/lib/libavbin.dylib: dlopen(/usr/local/lib/libavbin.dylib, 6): no suitable image found.  Did find:
        /usr/local/lib/libavbin.dylib: no matching architecture in universal wrapper
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pyglet/__init__.py", line 338, in __getattr__
    __import__(import_name)
  File "pyglet/media/__init__.py", line 1469, in <module>
    import avbin
  File "pyglet/media/avbin.py", line 64, in <module>
    darwin='/usr/local/lib/libavbin.dylib')
  File "pyglet/lib.py", line 111, in load_library
    lib = ctypes.cdll.LoadLibrary(name)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 443, in LoadLibrary
    return self._dlltype(name)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: dlopen(/usr/local/lib/libavbin.dylib, 6): no suitable image found.  Did find:
        /usr/local/lib/libavbin.dylib: no matching architecture in universal wrapper

>>> print(pyglet.media.avbin.get_version())
Unexpected error loading library /usr/local/lib/libavbin.dylib: dlopen(/usr/local/lib/libavbin.dylib, 6): no suitable image found.  Did find:
        /usr/local/lib/libavbin.dylib: no matching architecture in universal wrapper
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pyglet/__init__.py", line 338, in __getattr__
    __import__(import_name)
  File "pyglet/media/__init__.py", line 1469, in <module>
    import avbin
  File "pyglet/media/avbin.py", line 64, in <module>
    darwin='/usr/local/lib/libavbin.dylib')
  File "pyglet/lib.py", line 111, in load_library
    lib = ctypes.cdll.LoadLibrary(name)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 443, in LoadLibrary
    return self._dlltype(name)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: dlopen(/usr/local/lib/libavbin.dylib, 6): no suitable image found.  Did find:
        /usr/local/lib/libavbin.dylib: no matching architecture in universal wrapper
>>>

Any idea what's happening?

Thanks
Pepijn

________________________________________
From: pyglet...@googlegroups.com [pyglet...@googlegroups.com] On Behalf Of Nathan [nathan...@gmail.com]
Sent: Friday, December 07, 2012 9:58 AM
To: pyglet...@googlegroups.com
Subject: Re: pyglet on Mac OS Mountain Lion?

On Thu, Dec 6, 2012 at 4:39 PM, pepijn <pep...@boltcreative.com<mailto:pep...@boltcreative.com>> wrote:
Hey Nathan/all,

Thanks for outlining these steps. Unfortunately i'm still getting the same quick time errors as Steve Willis above. I had previously installed Pyglet 1.1.4 through pyglet.org... Maybe i should've uninstalled that one before i followed your steps. Not sure how to uninstall though. I looked through their documentation but they only tell you how to install. Anyone any ideas?

Lets check to see if everything got upgraded like you expected.  Try running python, and then running the following commands:

import pyglet
print(pyglet.version)
print(pyglet.media.have_avbin)
print(pyglet.media.avbin.get_version())

For example, on one of my machines it looks like this:

$ python
Python 2.7.2 (default, Jun 20 2012, 16:23:33)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyglet
>>> print(pyglet.version)
1.2alpha1
>>> print(pyglet.media.have_avbin)
True
>>> print(pyglet.media.avbin.get_version())
11

Also, can i use the stock python that comes with os x 10.8?

You can if you install the development version of pyglet from the mercurial repository.

Thanks for all the help here in any case!

I hope this helps.  :-)

~ Nathan

--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
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.

--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
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.


George Wright

unread,
Dec 10, 2012, 2:59:31 PM12/10/12
to pyglet...@googlegroups.com
Nathan
I'm having problems too. OSX 10.8.2
Apple supplied python 2.7.2
Installed the prerelease avbin version 11 package (second of your links below) after getting a False for 
print(pyglet.media.have_avbin) call.

Got this error message:
Last login: Mon Dec 10 06:52:46 on ttys001
GeoMacBkPro:~ georgewright$ python
Python 2.7.2 (default, Jun 20 2012, 16:23:33) 
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyglet
>>> print(pyglet.version)
1.2alpha1
>>> print(pyglet.media.have_avbin)
Unexpected error loading library /usr/local/lib/libavbin.dylib: dlopen(/usr/local/lib/libavbin.dylib, 6): no suitable image found.  Did find:
/usr/local/lib/libavbin.dylib: open() failed with errno=13
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/pyglet/__init__.py", line 338, in __getattr__
    __import__(import_name)
  File "/Library/Python/2.7/site-packages/pyglet/media/__init__.py", line 1469, in <module>
    import avbin
  File "/Library/Python/2.7/site-packages/pyglet/media/avbin.py", line 64, in <module>
    darwin='/usr/local/lib/libavbin.dylib')
  File "/Library/Python/2.7/site-packages/pyglet/lib.py", line 111, in load_library
    lib = ctypes.cdll.LoadLibrary(name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 431, in LoadLibrary
    return self._dlltype(name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 353, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: dlopen(/usr/local/lib/libavbin.dylib, 6): no suitable image found.  Did find:
/usr/local/lib/libavbin.dylib: open() failed with errno=13
>>> 
What do you suggest?
Regards
George Wright
      Steve Willis <steve....@gmail.com> Dec 07 10:28AM -0800  

      I am using the latest development Pyglet from the mercurial repository on
      OSX 10.8 without issue, aside from the need to suppress the Application
      State file as described previously. I haven't run any tests outside of my
      own project, but it seems to be very stable thus far.
       
      Steve
       
      On Friday, December 7, 2012 10:58:41 AM UTC-7, Nathan wrote:
       
      Nathan <nathan...@gmail.com> Dec 07 11:49AM -0700  

      > State file as described previously. I haven't run any tests outside of my
      > own project, but it seems to be very stable thus far.
       
      > Steve
       
      That is so weird that you have to suppress the creation of the "~/Library/Saved
      Application State/org.python.python.savedState" directory. That directory
      exists on all my 10.8 installations, but has never caused a problem.
       
      Does the problem occur even if you do a basic "hello world" pyglet app?
       
      ~ Nathan
       
      Steve Willis <steve....@gmail.com> Dec 07 11:20AM -0800  

      Yes. In fact, I am very new to Pyglet, and initially encountered this issue
      when trying the first "Hello, World" example in the Pyglet documentation.
      The development version runs without error and the Python process is
      running, but no window appears. After suppressing the creation of the
      org.python.python.savedState file, everything has gone smoothly.
       
      A little research tells me that this file, and the many others like it, are
      part of the feature which can be configured with the "Close windows when
      quitting an application" checkbox found in System Preferences | General. In
      my case, checking this box did not solve the problem by itself, but the
      file is related to this feature allowing for OSX to restore the window
      state and open documents within for compliant applications.
       
      I have also observed that this file is not created immediately in all
      cases. Before suppressing the creation of the file by locking permissions
      on the Application State folder (disabling this feature for all other
      applications as well), I tried manually deleting it while developing a
      simple test application. In some cases, it was several minutes before the
      file was created. In some cases I could even launch my application again
      after its creation, but not consistently. The only method that has proved
      reliable is to avoid creating the file in the first place.
       
      One final tidbit: I also tried simply checking for the existence of this
      file and deleting it when found as the first task in my Python script. This
      did not work. As a result, I suspect that the file is created at the time
      Pyglet is initialized on import, and not necessarily at the time a window
      is actually displayed.
       
      Steve
       
      On Friday, December 7, 2012 11:49:39 AM UTC-7, Nathan wrote:
       
      Phillip Nguyen <evil.p...@gmail.com> Dec 07 02:50PM -0600  

      Wow, thanks! With this information I found the ApplePersistenceIgnoreState key, and I've committed a fix that should prevent the org.python.python.savedState file from ever being created or used. This fixes the problem of new windows not being displayed after finishLaunching got called. It also explains why the problem was only showing up with certain builds of python and not pypy. There is an Xcode build setting that can be checked to prevent automatic state restoration for the application and I'm guessing the python from python.org doesn't have this set.
       
      When you run a pyglet program from the terminal, there is a warning message saying that it won't be saving or restoring state. But I think I can live with that.
       
      --phillip
       
       
        Nathan <nathan...@gmail.com> Dec 07 11:26PM -0700  

        Awesome! Thanks for fixing that, Phillip.
         
        ~ Nathan
         
         
         
        Nathan <nathan...@gmail.com> Dec 07 11:11AM -0700  

        I'd welcome the feature. I don't yet know enough Cocoa to figure out how
        to implement it myself, though.
         
        ~ Nathan
         
         
         
        Richard Jones <r1char...@gmail.com> Dec 08 09:33AM +1100  

        I recall implementing it for Carbon but I don't have the experience with
        Cocoa at this point.
         
        Sent from my portable device, please excuse the brevity.
         
        Nathan <nathan...@gmail.com> Dec 07 11:09AM -0700  

        I would guess it should be possible assuming Windows 7 allows opening a
        window in the background. That's OS-specific behavior, obviously. I
        personally know very little about programming on MS Windows windowing
        systems.
         
        ~ Nathan
         
         
         
        anatoly techtonik <tech...@gmail.com> Dec 07 06:03AM -0800  

        I've noticed that pyglet uses bottom left corner as (0,0) origin. This
        creates problems with code ported from pygame, processing and other
        applications from 2D graphics world where things are traditionally drawn
        from top to bottom.
         
        Is it possible to define a pyglet mode, where Y axes starts from the top?
         
        Anonymouse <anonymo...@gmail.com> Dec 07 05:09PM +0100  

        It is possible to make your own on_resize function that uses the top-right
        corner as the origin - it's simply a matter of OpenGL projection matrix.
         
        You'll want something like this...
        @window.event
        def on_resize(width, height):
        glViewport(0, 0, width, height)
        glMatrixMode(GL_PROJECTION)
        glLoadIdentity()
        glOrtho(0, width, height, 0, 0.1, 1000)
         
        Not tested but I think it should be right.
         
         
         

      You received this message because you are subscribed to the Google Group pyglet-users.
      You can post via email.
      To unsubscribe from this group, send an empty message.
      For more options, visit this group.


      --
      You received this message because you are subscribed to the Google Groups "pyglet-users" group.
      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.

      George Wright
      geor...@bigpond.net.au



      Nathan

      unread,
      Dec 10, 2012, 11:53:14 PM12/10/12
      to pyglet...@googlegroups.com
      What's the output of "ls -l /usr/local/lib"?

      ~ Nathan

      George Wright

      unread,
      Dec 11, 2012, 2:35:22 PM12/11/12
      to pyglet...@googlegroups.com
      Nathan

      Last login: Wed Dec 12 06:21:32 on console
      GeoMacBkPro:~ georgewright$ ls -l /usr/local/lib
      total 21952
      -rwx------  1 503   503    11210332 26 Nov 15:28 libavbin.11.dylib
      lrwxr-xr-x  1 root  wheel        32 11 Dec 06:43 libavbin.dylib -> /usr/local/lib/libavbin.11.dylib
      -rw-r--r--  1 root  wheel     55936 29 Nov 14:11 libsecurity_agent_client.a
      -rw-r--r--  1 root  wheel      9712 29 Nov 14:11 libsecurity_agent_server.a
      lrwxr-xr-x  1 root  wheel        16 17 Nov 15:57 wxPython -> wxPython-2.9.4.0
      drwxr-xr-x  6 root  wheel       204 22 Jul 07:26 wxPython-2.9.4.0
      GeoMacBkPro:~ georgewright$ 

      George

      On 11/12/2012, at 8:43 PM, pyglet...@googlegroups.com wrote:



          What's the output of "ls -l /usr/local/lib"?
           
          ~ Nathan
           
           
           

          You received this message because you are subscribed to the Google Group pyglet-users.


          You can post via email.
          To unsubscribe from this group, send an empty message.
          For more options, visit this group.


          --
          You received this message because you are subscribed to the Google Groups "pyglet-users" group.
          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.

          George Wright
          geor...@bigpond.net.au



          Nathan

          unread,
          Dec 11, 2012, 6:26:42 PM12/11/12
          to pyglet...@googlegroups.com
          How did libavbin.11.dylib get owned by user 503 and group 503, with permissions 700?  That's the problem.  The 11alpha4 installer *ought* to correctly set that to user root, group wheel, with permissions 775.

          The manual fix is to run these commands:

          sudo chown root:wheel /usr/local/lib/libavbin.11.dylib
          sudo chmod 775 /usr/local/lib/libavbin.11.dylib

          Give that a try and let me know if it works.

          ~ Nathan

          George Wright

          unread,
          Dec 11, 2012, 10:56:47 PM12/11/12
          to pyglet...@googlegroups.com
          Nathan
          OK did that chown, chmod as you suggested:
          GeoMacBkPro:~ georgewright$ ls -l /usr/local/lib
          total 21952
          -rwxrwxr-x  1 root  wheel  11210332 26 Nov 15:28 libavbin.11.dylib
          lrwxr-xr-x  1 root  wheel        32 11 Dec 06:43 libavbin.dylib -> /usr/local/lib/libavbin.11.dylib
          -rw-r--r--  1 root  wheel     55936 29 Nov 14:11 libsecurity_agent_client.a
          -rw-r--r--  1 root  wheel      9712 29 Nov 14:11 libsecurity_agent_server.a
          lrwxr-xr-x  1 root  wheel        16 17 Nov 15:57 wxPython -> wxPython-2.9.4.0
          drwxr-xr-x  6 root  wheel       204 22 Jul 07:26 wxPython-2.9.4.0

          Then print (pyglet.media.have_avbin):

          GeoMacBkPro:~ georgewright$ python
          Python 2.7.2 (default, Jun 20 2012, 16:23:33) 
          [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
          Type "help", "copyright", "credits" or "license" for more information.
          >>> import pyglet
          >>> print (pyglet.version)
          1.2alpha1
          >>> print (pyglet.media.have_avbin)
          True
          >>> 

          OK
          I haven't had a chance to test pyglet any more than that yet .....
          will let you know soon as .
          Thanks
          George

          George Wright

          unread,
          Dec 20, 2012, 4:41:38 PM12/20/12
          to pyglet...@googlegroups.com
          Nathan
          That all worked.
          But I began having the non-appearing window problem discussed on this thread earlier.
          I can fix it (OSX 10.8.2) by trashing the "org.python.python.savedState" folder as described there. But other than repeating that trashing each time the problem reappears I couldn't find anything in the thread that outlined a permanent solution.
          Do you know anything af that?

          Regards
          George Wright
          George Wright
          geor...@bigpond.net.au



          Phillip Nguyen

          unread,
          Dec 20, 2012, 5:18:10 PM12/20/12
          to pyglet...@googlegroups.com

          Are you using the latest pyglet version from the repository?  The last change I committed on Dec 7 should have fixed this problem.

          --phillip

          Phillip Nguyen

          unread,
          Mar 3, 2013, 9:03:42 PM3/3/13
          to pyglet...@googlegroups.com

          This message is "normal". The patch that I added was to prevent Mac OS X from automatically using or saving the application state (the org.python.python.savedState file referred to below). The side-effect is that you see this message on the console when you load pyglet. I couldn't find any way to suppress it. But you should be able to create and see multiple windows on Mountain Lion now.

          Note that pyglet won't delete the org.python.python.savedState file if it already exists (which may be the case if you ran some other windowed python program), but it does completely ignore the saved state file now.

          --phillip


          On Mar 3, 2013, at 5:23 AM, Julien Pilla <vrlitwhai...@gmail.com> wrote:

          >
          > Hello,
          > I retrieved the last version from the repository (it fixed an annoying bug so I'm happy) and now I have the same message that some peoples here:
          >
          > 2013-03-03 12:10:59.369 Python[37265:f07] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/jh/jgdg2_r52x37y8dd94mylk640000gn/T/org.python.python.savedState
          >
          > So the issue may still be open.
          > Thanks !
          >
          >
          > Le jeudi 20 décembre 2012 23:18:10 UTC+1, Phillip Nguyen a écrit :
          >
          > Are you using the latest pyglet version from the repository? The last change I committed on Dec 7 should have fixed this problem.
          >
          > --phillip
          >
          >
          > On Dec 20, 2012, at 3:41 PM, George Wright <geor...@bigpond.net.au> wrote:
          >
          >> Nathan
          >> That all worked.
          >> But I began having the non-appearing window problem discussed on this thread earlier.
          >> I can fix it (OSX 10.8.2) by trashing the "org.python.python.savedState" folder as described there. But other than repeating that trashing each time the problem reappears I couldn't find anything in the thread that outlined a permanent solution.
          >> Do you know anything af that?
          >
          >
          > --
          > 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.
          > Visit this group at http://groups.google.com/group/pyglet-users?hl=en.
          > For more options, visit https://groups.google.com/groups/opt_out.
          >
          >

          Reply all
          Reply to author
          Forward
          0 new messages