Sorry it comes 5 years late, but the way I solved it was:
1. noticing the image kitten.jpg does not exist in the first place
2 the error is basically telling you there is no image called kitten.jpg on
your working directory "the place where your .py script is saved"
On Saturday, 6 March 2010 08:44:59 UTC+1, Alejandro Castellanos wrote:
>
> So, I was finally dusting my old pyglet skills after a good, long
> while of not using them and ended up stumbling into this weird,
> bizarre problem, even with the bundled examples for pyglet 1.1.4.
>
> All I ever wanted was to show an image on screen, period. I've done
> weirder things.
>
> Here's the code that mostly about everyone should be familiar with:
>
> ----------------------------------------
>
> import pyglet
>
> window = pyglet.window.Window()
> image = pyglet.resource.image('kitten.jpg')
>
> @window.event
> def on_draw():
> window.clear()
> image.blit(0, 0)
>
> pyglet.app.run()
>
> ------------------------------------
>
> And here's the error message:
> -----------------------------------------------
>
> Traceback (most recent call last):
> File "C:\Users\alejandro\Downloads\pyglet-1.1.4-docs\examples
> \programming_guide\image_viewer.py", line 45, in <module>
> image = pyglet.resource.image('kitten.jpg')
> File "C:\Python26\lib\site-packages\pyglet\resource.py", line 492,
> in image
> identity = self._cached_images[name] = self._alloc_image(name)
> File "C:\Python26\lib\site-packages\pyglet\resource.py", line 436,
> in _alloc_image
> file = self.file(name)
> File "C:\Python26\lib\site-packages\pyglet\resource.py", line 394,
> in file
> raise ResourceNotFoundException(name)
> ResourceNotFoundException: Resource "kitten.jpg" was not found on the
> path. Ensure that the filename has the correct captialisation.
>
> -----------------------------------------------
>
> The odd thing is that if I double-click on the file, it executes and
> shows the image of the kitty, not a problem.
>
> Weird, I say.
>
> I don't know if the problem is with IDLE, or the version number
> (1.1.4), or my OS (Vista, 64 bits)...or a combination of all of those.
>
> I've done this a million times, and I don't know what could be wrong.
>
> Thanks in advance.
>
>
--
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.