Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #51511 > unrolled thread
| Started by | Devyn Collier Johnson <devyncjohnson@gmail.com> |
|---|---|
| First post | 2013-07-29 18:22 -0400 |
| Last post | 2013-07-29 22:40 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Has anyone gotten Pyglet to work Devyn Collier Johnson <devyncjohnson@gmail.com> - 2013-07-29 18:22 -0400
Re: Has anyone gotten Pyglet to work Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-07-29 22:40 +0000
| From | Devyn Collier Johnson <devyncjohnson@gmail.com> |
|---|---|
| Date | 2013-07-29 18:22 -0400 |
| Subject | Re: Has anyone gotten Pyglet to work |
| Message-ID | <mailman.5278.1375136910.3114.python-list@python.org> |
[Multipart message — attachments visible in raw view] — view raw
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
[toc] | [next] | [standalone]
| From | Steven D'Aprano <steve+comp.lang.python@pearwood.info> |
|---|---|
| Date | 2013-07-29 22:40 +0000 |
| Message-ID | <51f6ef4a$0$30000$c3e8da3$5496439d@news.astraweb.com> |
| In reply to | #51511 |
On Mon, 29 Jul 2013 18:22:02 -0400, Devyn Collier Johnson wrote:
> 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.
[...]
> 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
You have a media file (boot.ogg) which pyglet is trying to play using
AVbin, but you don't have AVbin.
As far as I know, pip is incapable of handling non-Python dependencies. I
suggest you try your system's package manager:
Debian/Ubuntu:
sudo aptitude install AVbin
-or-
sudo apt-get install AVbin
RedHat/Fedora/Centos:
sudo yum install AVbin
and hopefully your distro will already support the latest, or at least
working, version.
--
Steven
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web