title: AttributeError when unpickling an object
body: <p>I'm trying to pickle an instance of a class in one module, and unpickle it in another.</p>
  
  <p>Here's where I pickle:</p>
  
  <pre><code>import cPickle
  
  def pickleObject():
      object = Foo()
      savefile = open('path/to/file', 'w')
      cPickle.dump(object, savefile, cPickle.HIGHEST_PROTOCOL)
  
  
  class Foo(object):
      (...)
  </code></pre>
  
  <p>and here's where I try to unpickle:</p>
  
  <pre><code>savefile = open('path/to/file', 'r')
  object = cPickle.load(savefile)
  </code></pre>
  
  <p>On that second line, I get <code>AttributeError: 'module' object has no attribute 'Foo'</code></p>
  
  <p>Anyone see what I'm doing wrong?</p>