Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!ecngs!feeder2.ecngs.de!newsfeeder.ewetel.de!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'newbie': 0.05; 'attribute': 0.07; 'filename:fname piece:py': 0.07; 'python3': 0.07; 'rename': 0.07; 'skip:" 60': 0.07; '__init__': 0.09; 'collier': 0.09; 'file)': 0.09; 'setup.py': 0.09; 'python': 0.11; 'error).': 0.16; 'once.': 0.16; 'python3.': 0.16; 'script,': 0.16; "ubuntu's": 0.16; 'url:html)': 0.16; 'wrote:': 0.18; 'module': 0.19; 'import': 0.22; 'install': 0.23; 'load': 0.23; 'header:User- Agent:1': 0.23; 'error': 0.23; 'module,': 0.24; 'source': 0.25; 'script': 0.25; 'attached.': 0.26; 'least': 0.26; 'downloaded': 0.26; 'skip:" 20': 0.27; 'skip:_ 20': 0.27; 'header:In-Reply- To:1': 0.27; 'installed': 0.27; 'tried': 0.27; 'appear': 0.29; 'skip:p 30': 0.29; 'code': 0.31; 'getting': 0.31; 'received:10.0.0': 0.31; 'gary': 0.31; 'python2.7': 0.31; 'file': 0.32; 'skip:c 30': 0.32; 'running': 0.33; '(most': 0.33; 'skip:# 10': 0.33; 'device': 0.34; 'skip:d 20': 0.34; 'common': 0.35; 'johnson': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'installing': 0.36; 'done': 0.36; 'thanks': 0.36; 'received:10.0': 0.36; 'received:10': 0.37; 'skip:& 10': 0.38; 'skip:. 20': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'recent': 0.39; 'skip:. 10': 0.39; 'url:2012': 0.39; 'to:addr:python.org': 0.39; 'media': 0.66; 'p.s.': 0.66; 'note:': 0.66; 'url:17': 0.68; 'default': 0.69; 'fail.': 0.84; 'song': 0.84; 'sound.': 0.84; 'suffer': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=fsXMxWEbnS4f8mfZdYXohhqkYTpM6l+WmqR1MeyUuLA=; b=08PkbqXJgpQdx3ZSTFJSR98+JE/S+AFXX0xdoGpZlzh/v9czKWPT5+bj0Bq1Aeg+BP rj0Zx5a0DtGkNujmz2uUidCFACqFsa46rf3s90fzdAiIrKdAUaf4KBPxS0y6kmBC3159 IGyrkrvE+jGHpwsp51rEUWCA32ETZ4zmj0cOOloON4cyT6gsAloKJGuUdsstQH63IPbm bgybQwU2YAxKOvXxpuP+/89GwotQfgzle7IfR6DbjphTGP8Kh/p7LEhUhvqiDyDSiVOb 08Yoj78zWQrNJksBE38O+X5djd7jjENxgc5ZBekKvXTxg9PFg0KqIPAn3/XPrSM/m99G CLtA== X-Received: by 10.236.34.162 with SMTP id s22mr28098614yha.119.1375136525845; Mon, 29 Jul 2013 15:22:05 -0700 (PDT) Date: Mon, 29 Jul 2013 18:22:02 -0400 From: Devyn Collier Johnson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7 MIME-Version: 1.0 To: Python Mailing List Subject: Re: Has anyone gotten Pyglet to work References: <51F6D6E6.2070004@Gmail.com> <51F6D9D1.7080709@islandtraining.com> In-Reply-To: <51F6D9D1.7080709@islandtraining.com> Content-Type: multipart/mixed; boundary="------------010707040504020007070702" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 205 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1375136910 news.xs4all.nl 15910 [2001:888:2000:d::a6]:58761 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:51511 This is a multi-part message in MIME format. --------------010707040504020007070702 Content-Type: multipart/alternative; boundary="------------010607030607010205000503" --------------010607030607010205000503 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 07/29/2013 05:08 PM, Gary Herron wrote: > 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 >> (http://guzalexander.com/2012/08/17/playing-a-sound-with-python.html). >> >> collier@Nacho-Laptop:~$ ./pyglet.py >> Traceback (most recent call last): >> File "./pyglet.py", line 2, in >> import pyglet >> File "/home/collier/pyglet.py", line 3, in >> song = pyglet.media.load('./boot.ogg') >> AttributeError: 'module' object has no attribute 'media' >> >> >> Mahalo, >> >> DCJ >> >> > > 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. :^) ) > > > Duh, thanks for the tip (^u^), but I still get an error (different error). NOTE: this is all python2.7 code because Pyglet supposedly has issues with Python3. collier@Nacho-Laptop:~$ pip install pyglet Downloading/unpacking pyglet Downloading pyglet-1.1.4.tar.gz (2.9MB): 2.9MB downloaded Running setup.py egg_info for package pyglet .......Blah........ .......Blah........ Installing collected packages: pyglet Running setup.py install for pyglet Successfully installed pyglet Cleaning up... collier@Nacho-Laptop:~/pytest$ ./pymedia.py Traceback (most recent call last): File "./pymedia.py", line 3, in song = pyglet.media.load('./boot.ogg') File "/usr/local/lib/python2.7/dist-packages/pyglet/media/__init__.py", line 1386, in load source = _source_class(filename, file) File "/usr/local/lib/python2.7/dist-packages/pyglet/media/riff.py", line 202, in __init__ 'AVbin is required to decode compressed media') pyglet.media.riff.WAVEFormatException: AVbin is required to decode compressed media AL lib: ReleaseALC: 1 device not closed collier@Nacho-Laptop:~/pytest$ ls boot.ogg pymedia.py Mahalo, DCJ --------------010607030607010205000503 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
On 07/29/2013 05:08 PM, Gary Herron wrote:
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 (http://guzalexander.com/2012/08/17/playing-a-sound-with-python.html).

collier@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'


Mahalo,

DCJ



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.  :^) )



Duh, thanks for the tip (^u^), but I still get an error (different error). NOTE: this is all python2.7 code because Pyglet supposedly has issues with Python3.

collier@Nacho-Laptop:~$ pip install pyglet
Downloading/unpacking pyglet
  Downloading pyglet-1.1.4.tar.gz (2.9MB): 2.9MB downloaded
  Running setup.py egg_info for package pyglet
.......Blah........
.......Blah........
Installing collected packages: pyglet
  Running setup.py install for pyglet
Successfully installed pyglet
Cleaning up...
collier@Nacho-Laptop:~/pytest$ ./pymedia.py
Traceback (most recent call last):
  File "./pymedia.py", line 3, in <module>
    song = pyglet.media.load('./boot.ogg')
  File "/usr/local/lib/python2.7/dist-packages/pyglet/media/__init__.py", line 1386, in load
    source = _source_class(filename, file)
  File "/usr/local/lib/python2.7/dist-packages/pyglet/media/riff.py", line 202, in __init__
    'AVbin is required to decode compressed media')
pyglet.media.riff.WAVEFormatException: AVbin is required to decode compressed media
AL lib: ReleaseALC: 1 device not closed
collier@Nacho-Laptop:~/pytest$ ls
boot.ogg  pymedia.py



Mahalo,

DCJ
--------------010607030607010205000503-- --------------010707040504020007070702 Content-Type: text/x-python; name="pyglet.py" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="pyglet.py" #!/usr/bin/env python import pyglet song = pyglet.media.load('./boot.ogg') song.play() pyglet.app.run() --------------010707040504020007070702--