I'm making progress, but I'm not out of the woods yet.

I'm trying to run some of the programs from the tutorial web pages, and from 
the pyglet1.2alpha1/examples directory.  I've realized that I will probably 
need to run 2to3 on the many of the latter.  

The Hello, World example runs.

http://www.pyglet.org/doc/programming_guide/hello_world.html

The Image Viewer example... 

http://www.pyglet.org/doc/programming_guide/image_viewer.html

...runs if I provide a local image file, and load it using pyglet.image.load(). 
 As written, the example fails on the line:

image = pyglet.resource.image('kitten.jpg')  

It's possible that the alpha1.2 version of PyGLet is missing some resources.

It looks like the code for the bouncing ball example ought to work, but it 
doesn't.  That code can be found on the web at:

http://www.pyglet.org/doc/programming_guide/noisy.py

and also in the PyGLet package, in the folder pyglet1.2alpha1/examples/noisy.  

Here's my traceback which, I am sorry to report, I find less than fully 
informative:

===============================

Traceback (most recent call last):
  File "/usr/local/lib/python3.3/dist-packages/pyglet/__init__.py", line 332, 
in __getattr__
    return getattr(self._module, name)
AttributeError: 'NoneType' object has no attribute 'load'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.3/dist-packages/pyglet/lib.py", line 111, in 
load_library
    lib = ctypes.cdll.LoadLibrary(name)
  File "/usr/lib/python3.3/ctypes/__init__.py", line 431, in LoadLibrary
    return self._dlltype(name)
  File "/usr/lib/python3.3/ctypes/__init__.py", line 353, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libavbin.so: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "noisy.py", line 56, in <module>
    sound = pyglet.resource.media(BALL_SOUND, streaming=False)
  File "/usr/local/lib/python3.3/dist-packages/pyglet/resource.py", line 610, 
in media
    return media.load(path, streaming=streaming)
  File "/usr/local/lib/python3.3/dist-packages/pyglet/__init__.py", line 338, 
in __getattr__
    __import__(import_name)
  File "/usr/local/lib/python3.3/dist-packages/pyglet/media/__init__.py", line 
1469, in <module>
    from . import avbin
  File "/usr/local/lib/python3.3/dist-packages/pyglet/media/avbin.py", line 64, 
in <module>
    darwin='/usr/local/lib/libavbin.dylib')
  File "/usr/local/lib/python3.3/dist-packages/pyglet/lib.py", line 118, in 
load_library
    if ((self.linux_not_found_error not in o.message) and
AttributeError: 'OSError' object has no attribute 'message'

===============================

I think that only the top few lines of this traceback are relevant.  Somehow a 
None is being passed into some function in pyglet/__init__.py, when that 
function expects an object with an attribute named "load".  Looking at the 
source, the function being called is _ModuleProxy.__getattr__().

I often find that Python's tracebacks stop one level short of what I really 
want to know.  The top level calling function is frequently not named.  What 
part of noisy.py called the code that crashed?  Is there any way to get 
traceback to tell you more?

Anyway, I wondered whether this might be a Python compatibility wart in 
noisy.py.  Thus I tried running 2to3 on noisy.py, even though my eyes told me 
that the code was OK.  2to3 agreed with me, reporting: "RefactoringTool: No 
changes to noisy.py".

I'm not sure where to go next with this.  One thing is for certain, all of this 
is way over the heads of my students...
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to