title: Python Multiprocessing error: AttributeError: module '__main__' has no attribute '__spec__'
body: <p>I'm using Python 3.6 and am trying to follow along with the very first example at the website below (full code also below) and am getting the below error:
  <a href="https://docs.python.org/3.6/library/multiprocessing.html" rel="noreferrer">https://docs.python.org/3.6/library/multiprocessing.html</a></p>
  
  <p>Error message:
  <code>AttributeError: module '__main__' has no attribute '__spec__'</code></p>
  
  <p>Full example code:</p>
  
  <pre><code>from multiprocessing import Pool
  
  def f(x):
      return x*x
  
  if __name__ == '__main__':
      with Pool(5) as p:
          print(p.map(f, [1, 2, 3]))
  </code></pre>
  
  <p>I tried Googling it and searching Stack Overflow but I've only found one other case of this error and it did not have an answer.</p>