title: ImageFont IO error: cannot open resource
body: <p>I am new to Python and tried to run the following code. I received the following error <code>"IOError: cannot open resource"</code>. Is this due to the fact that some of the Image characteristics do not longer exist (e.g. Coval.otf), or is it potentially due to writing/reading restrictions? please let me know - many thanks, W</p>
  
  <pre><code>import numpy as np
  from PIL import Image, ImageDraw, ImageFont
  from skimage import transform as tf
  
  def create_captcha(text, shear=0, size=(100,24)):
      im = Image.new("L", size, "black")
      draw = ImageDraw.Draw(im)
      font = ImageFont.truetype(r"Coval.otf", 22)
      draw.text((2, 2), text, fill=1, font=font)
      image = np.array(im)
      affine_tf = tf.AffineTransform(shear=shear)
      image = tf.warp(image, affine_tf)
      return image / image.max()
  
  %matplotlib inline
  from matplotlib import pyplot as plt
  image = create_captcha("GENE", shear=0.5)
  </code></pre>