title: Half my Python2.7 standard library modules "went missing". How do I debug this?
body: <p>I woke up this morning and found that half my standard library "went missing". It was working fine earlier this week. I haven't made any major system config changes in the past few days that would affect my Python installation (I don't think).</p>
  
  <p>Basically, the following modules now throw "No module named x" errors from the REPL: <code>math</code>, <code>time</code>, <code>itertools</code>, <code>functools</code></p>
  
  <p>The following modules continue to work: <code>os</code>, <code>sys</code>, <code>abc</code>, <code>thread</code></p>
  
  <p>I haven't tested all the modules, but is there some way to debug this? Another side effect appears to be that the "up" and "down" arrows now print <code>^[[A</code> and <code>^[[B</code> instead of scrolling through history.</p>
  
  <p>My Python is located at <code>/Library/Frameworks/Python.framework/Versions/2.7/bin/python</code>, discovered via <code>which python</code>.</p>
  
  <p>I've verified that all standard library files do indeed exist in <code>/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7</code>.</p>
  
  <p>Running <code>os.environ['PYTHONPATH']</code> returns a KeyError, which seems strange, but I've never had to explicitly set the PYTHONPATH before, and haven't modified my bash profile in the last few weeks.</p>
  
  <p>I wasn't able to find anything relating to this specific issue, but I could well be missing something obvious. Any help is appreciated, thanks!</p>