title: python multiprocess can't get attribute
body: <p>I have my function:</p>
  <pre><code>downloadXMLPool = Pool(processes=3)
  downloadFile = Pool(processes=3)
  
  
  def dl_data_and_convert(url,formatIn,retry=True,noHTML=False,downloadSpecialPool=None):
      if downloadSpecialPool == None:
          dlPool = downloadXMLPool
      else:
          dlPool = downloadSpecialPool
  
      if formatIn == 'xml':
          return dl_xml_to_dict(url,dlPool,retry=retry,noHTML=noHTML)
      elif formatIn == 'json':
          return dl_json_to_dict(url,dlPool,retry=retry,noHTML=noHTML)
  
  
  def dl_xml_to_dict(url,dlPool,retry=True,tryNumber=1,noHTML=False):
      try:
          response = None
          doc = xmltodict.parse(dlPool.apply_async(requests.get, (url,)).get().content)
  
          if noHTML:
              if 'html' in doc:
                  if retry:
                      sleep(randrange(60,120)*tryNumber)
                      return dl_xml_to_dict(url,dlPool,tryNumber=tryNumber+1,noHTML=noHTML)
          return doc
  
      except Exception as e:
          if retry and request_error_tester(tryNumber,url,response,e):
              return dl_xml_to_dict(url,dlPool,tryNumber=tryNumber+1,noHTML=noHTML)
          else:
              return None
  
  </code></pre>
  <p>These two functions work fine.</p>
  <p>And I have them:</p>
  <pre><code>def download_file(url, NameFile, folder='./', retry=True, downloadSpecialPool=None):
      if downloadSpecialPool == None:
          return launch_dl_in_file(url, downloadFile, NameFile, folder=folder, retry=retry)
      else:
          return launch_dl_in_file(url, downloadSpecialPool, NameFile, folder=folder, retry=retry)
  
  
  def launch_dl_in_file(url, dlPool, NameFile, folder='./', retry=True, tryNumber=1):
      try:
          dlPool.apply_async(dl_in_file, (url, NameFile, folder)).get()
          return True
  
      except Exception as e:
          if match('.*HTTP Error 504.*',str(e)) != None:
              if retry:
                  if tryNumber &lt; 21:
                      sleep(15*tryNumber)
                      return launch_dl_in_file(url, dlPool, NameFile, folder=folder, tryNumber=tryNumber+1)
          print_screen_error(&quot;Download error for file : &quot;+url+&quot;\n\tError : &quot;+str(e)+&quot;\n&quot;)
          return False
  
  
  def dl_in_file(url, NameFile, folder='./'):
      with closing(urllib.request.urlopen(url)) as r:
          with open(os.path.join(folder,NameFile), 'wb') as f:
              shutil.copyfileobj(r, f)
      return True
  
  </code></pre>
  <p>And I obtain this error:</p>
  <pre><code>AttributeError: Can't get attribute 'dl_in_file' on &lt;module 'tools' from '/home/*/src/tools.py'&gt;
  </code></pre>
  <p>I tried some modifications: use another multiprocess pool, use the downloadXMLPool, new function, etc. I still had the same issue.</p>
  <pre><code>Process ForkPoolWorker-4:
  Traceback (most recent call last):
    File &quot;/usr/lib/python3.7/multiprocessing/process.py&quot;, line 297, in _bootstrap
      self.run()
    File &quot;/usr/lib/python3.7/multiprocessing/process.py&quot;, line 99, in run
      self._target(*self._args, **self._kwargs)
    File &quot;/usr/lib/python3.7/multiprocessing/pool.py&quot;, line 110, in worker
      task = get()
    File &quot;/usr/lib/python3.7/multiprocessing/queues.py&quot;, line 354, in get
      return _ForkingPickler.loads(res)
  AttributeError: Can't get attribute 'dl_in_file' on &lt;module 'tools' from '/home/*/src/tools.py'&gt;
  </code></pre>
  <p>What am I possibly be doing wrong here?</p>