title: Using images as turtle shape
body: <p>I have been struggling with something probably very simple.
  I am trying to insert an image as turtle shape but an error keeps always there.</p>
  
  <p>My code is</p>
  
  <pre><code> import turtle
  
   shape_2 = turtle.Shape('image', 'exemple.gif')
   turtle.register_shape('play', shape_2)
   turtle.shape('play')
   turtle.forward(100)
   turtle.left(45)
   turtle.forward(50)
  </code></pre>
  
  <p>the error is </p>
  
  <pre><code>[evaluate testee.py]
  Traceback (most recent call last):
    File "C:/Users/Utilizador/Desktop/Python/testee.py", line 3, in &lt;module&gt;
      shape_2 = turtle.Shape('image', 'exemple.gif')
    File "C:\Users\Utilizador\Anaconda3\Lib\turtle.py", line 886, in __init__
      data = TurtleScreen._image(data)
    File "C:\Users\Utilizador\Anaconda3\Lib\turtle.py", line 479, in _image
      return TK.PhotoImage(file=filename)
    File "C:\Users\Utilizador\Anaconda3\Lib\tkinter\__init__.py", line 3539, in __init__
      Image.__init__(self, 'photo', name, cnf, master, **kw)
    File "C:\Users\Utilizador\Anaconda3\Lib\tkinter\__init__.py", line 3483, in __init__
      raise RuntimeError('Too early to create image')
  builtins.RuntimeError: Too early to create image
  </code></pre>
  
  <p>Thanks for the help</p>