-1

Here is my full code:

http://codr.io/tscumzc

And the error occurs with a music player called player:

Traceback (most recent call last):
  File "test.py", line 915, in <module>
    player.eos_action = player.EOS_LOOP
AttributeError: 'Player' object has no attribute 'EOS_LOOP'

I can confirm that all of the sound files are in the directory and I have installed pyglet with pip3, pygame, etc.

My game was working months ago but now that I'm coming back to it it is not working all of a sudden.

The offending piece of code is only the player initialization and the EOS_LOOP part, since I tried only doing that in python3 in the terminal and it wouldn't work even with pyglet imported.

Jack Pan
  • 1,261
  • 3
  • 11
  • 12

2 Answers2

2

The EOS_LOOP property was removed from the Player type in on March 7th, 2015 with this commit.

Before its removal, the constants were marked as deprecated:

#: The player will pause when it reaches the end of the stream.
#:
#: :deprecated: Use `SourceGroup.advance_after_eos`
EOS_PAUSE = 'pause'

#: The player will loop the current stream continuosly.
#:
#: :deprecated: Use `SourceGroup.loop`
EOS_LOOP = 'loop'

#: The player will move on to the next queued stream when it reaches the
#: end of the current source.  If there is no source queued, the player
#: will pause.
#:
#: :deprecated: Use `SourceGroup.advance_after_eos`
EOS_NEXT = 'next'

#: The player will stop entirely; valid only for ManagedSoundPlayer.
#:
#: :deprecated: Use `SourceGroup.advance_after_eos`
EOS_STOP = 'stop'

#: :deprecated:
_eos_action = EOS_NEXT

So according to that, you are supposed to use SourceGroup.loop now.

Since that change was in 2015, it’s likely that since then there were also other changes. So you should consider upgrading your code to the new version.

poke
  • 369,085
  • 72
  • 557
  • 602
0

It was deprecated as of at least 1.2.4.

This leads me to believe you're using a version in which the attribute was removed. You'll need to read the migration guide or fall back to an older version.

This can be done by specifying the version with pip install:

pip3 install xyz==0.1.2
erip
  • 16,374
  • 11
  • 66
  • 121