title: Can't get attribute 'function_inner' on <module '__mp_main__' from 'E:\\python\\Test\\test.py'>
body: <p>I'm trying to run a python script in windows 10 which has running succeed in macOS.
  Then it throws an exception. 
  After running the following test program:</p>
  
  <pre><code>#!/usr/bin/env python3
  # -*- coding: utf-8 -*-
  import multiprocessing
  
  
  def function_def(*args, **kwargs):
      print('run success')
  
  
  if __name__ == '__main__':
      def function_inner(*args, **kwargs):
          print('run success')
      process = multiprocessing.Process(target=function_inner)
      process.start()
      process.join()
  </code></pre>
  
  <p>It throws following exception:</p>
  
  <pre><code>Traceback (most recent call last):
  File "&lt;string&gt;", line 1, in &lt;module&gt;
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python36\lib\multiprocessing\spawn.py", line 105, in spawn_main
  exitcode = _main(fd)
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python36\lib\multiprocessing\spawn.py", line 115, in _main
  self = reduction.pickle.load(from_parent)
  AttributeError: Can't get attribute 'function_inner' on &lt;module '__mp_main__' from 'E:\\python\\Test\\test.py'&gt;
  </code></pre>
  
  <p>But, if use</p>
  
  <pre><code>process = multiprocessing.Process(target=function_def)
  </code></pre>
  
  <p>not for</p>
  
  <pre><code>process = multiprocessing.Process(target=function_inner)
  </code></pre>
  
  <p>then it run succeed</p>
  
  <p>I'm using python 3.6.1, windows 10 x64, so what should I do?</p>