title: How can I overcome this key word error?
body: <pre><code>enter code here
  
   # -*- coding: utf-8 -*-
  
  import math
  import matplotlib
  matplotlib.use("Agg")
  import matplotlib.pyplot as plt
  import matplotlib.animation as animation
  fig1=plt.figure()
  ax=plt.axes(xlim=(-10,10), ylim=(-10,10))
  line,=ax.plot([],[],lw=1)
  """def init ():
  line.set_data([],[])
  return line,"""
  
  dt=0.001
  X=[]
  Y=[]
  r=float(input("Enter the radius :: "))
  w=float(input("Enter angular frequency :: "))
  def run(data):
      t=0
      while w*t&lt;=2*math.pi:
         x=r*math.cos(w*t)
         y=r*math.sin(w*t)
         X.append(x)
         Y.append(y)
         t=t+dt
      line.set_data(X,Y)
      return line,   
  line,=ax.plot(X,Y,lw=2) 
  FFMpegWriter = animation.writers['ffmpeg']
  writer = FFMpegWriter(fps=15, metadata=dict(artist='Me'),        bitrate=1800)   
  anim=animation.FuncAnimation(fig1,run,frames=200,interval=20,blit=True)
  anim.save('amim.mp4',writer=writer)       
  </code></pre>
  
  <p>The error message shown is ::</p>
  
  <pre><code>Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "/home/tathagata/anaconda3/lib/python3.4/site-   packages/spyderlib/widgets/externalshell/sitecustomize.py", line 685, in runfile
  execfile(filename, namespace)
  File "/home/tathagata/anaconda3/lib/python3.4/site-  packages/spyderlib/widgets/externalshell/sitecustomize.py", line 85, in execfile
  exec(compile(open(filename, 'rb').read(), filename, 'exec'), namespace)
  File "/home/tathagata/Documents/Python scripts/circleamim.py", line 35, in &lt;module&gt;
  FFMpegWriter = animation.writers['ffmpeg']
  File "/home/tathagata/anaconda3/lib/python3.4/site-packages/matplotlib/animation.py", line 81, in __getitem__
  return self.avail[name]
  KeyError: 'ffmpeg' 
  </code></pre>
  
  <p>I use anacoda distribution and SPYDER as my IDE. I have seen the many solutions related to key errors. But the movie wont run. How can I make the movie to run? I hope there are no other logical errors. </p>