title: sys.argv interferes with importing pyplot in emacs interpreter
body: <p>I am running a python interpreter inside the Emacs program. I am trying to execute a script which, among other things, contains the statement <code>from matplotlib import pyplot as plt</code>. Since the script takes command-line arguments I set the <code>sys.argv</code> variable in the interpreter before calling <code>execfile</code>. In this case, I receive an error from the <code>import pyplot</code> statement: <code>AttributeError: 'int' object has no attribute 'startswith'</code>.</p>
  
  <p>However, if I first <code>import pyplot</code> independently in the interpreter and <em>then</em> <code>import sys</code> to set <code>sys.argv</code>, followed by <code>execfile</code>, everything runs smoothly.</p>
  
  <p>Why is this?</p>
  
  <p>P.S.: The exact <code>AttributeError</code> seems to depend on the element <code>sys.argv[-1]</code>. In the above example, it was an integer. If it's a string, then the error is <code>'module' has no attribute 'cbook'</code>.</p>