title: Jupyter notebook never finishes processing using multiprocessing (Python 3)
body: <p><a href="https://i.stack.imgur.com/CYdGJ.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/CYdGJ.jpg" alt="enter image description here"></a></p>
  
  <h1>Jupyter Notebook</h1>
  
  <p>I am using multiprocessing module basically, I am still learning the capabilities of multiprocessing. I am using the book by Dusty Phillips and this code belongs to it. </p>
  
  <pre><code>import multiprocessing  
  import random
  from multiprocessing.pool import Pool
  
  def prime_factor(value):
      factors = []
      for divisor in range(2, value-1):
          quotient, remainder = divmod(value, divisor)
          if not remainder:
              factors.extend(prime_factor(divisor))
              factors.extend(prime_factor(quotient))
              break
          else:
              factors = [value]
      return factors
  
  if __name__ == '__main__':
      pool = Pool()
      to_factor = [ random.randint(100000, 50000000) for i in range(20)]
      results = pool.map(prime_factor, to_factor)
      for value, factors in zip(to_factor, results):
          print("The factors of {} are {}".format(value, factors))
  </code></pre>
  
  <p>On the Windows PowerShell (not on jupyter notebook) I see the following </p>
  
  <pre><code>Process SpawnPoolWorker-5:
  Process SpawnPoolWorker-1:
  AttributeError: Can't get attribute 'prime_factor' on &lt;module '__main__' (built-in)&gt;
  </code></pre>
  
  <p>I do not know why the cell never ends running? </p>