Has anyone gotten Pyglet to work
gary.herron at islandtraining.com
Mon Jul 29 23:08:33 CEST 2013
On 07/29/2013 01:56 PM, Devyn Collier Johnson wrote:
> I tried Pyglet in a Python3 and a Python2 script, but both fail. The
> error code is below and the script is attached. The 'boot.ogg' file is
> Ubuntu's default bootup sound. I got my code from this link
> collier at Nacho-Laptop:~$ ./pyglet.py
> Traceback (most recent call last):
> File "./pyglet.py", line 2, in <module>
> import pyglet
> File "/home/collier/pyglet.py", line 3, in <module>
> song = pyglet.media.load('./boot.ogg')
> AttributeError: 'module' object has no attribute 'media'
You appear to have confused Python by having a module named pyglet AND a
local file named pyglet.py.
This when you say import pyglet, you are not getting the pyglet module,
but instead your own file pyglet.py, which of course, has nothing named
media in it.
Rename your file and try again.
P.S. It is a common newbie error to hide a system file like this and
suffer the consequence. We've all done it -- at least once. :^) )
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list