title: Can't get attribute 'abc' on <module '__main__' from 'abc_h.py'>
body: <p>I am defining a function in  python. Program file name itself is <strong>abc_d.py</strong> . I don't understand if i can import the same file inside again. </p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  import sys
  import multiprocessing
  num_processor=4
  pool = multiprocessing.Pool(num_processor)
  
  
  def abc(data):          
      w=np.dot(data.reshape(25,1),data.reshape(1,25)) 
      return w
  
  data_final=np.array(range(100))
  n=100
  error=[]
  k_list=[50,100,500,1000,2000]
  for k in k_list:
  
      dict_data={}    
      for d_set in range(num_processor):
          dict_data[d_set]=data_final[int(d_set*n/4):int((d_set+1)*n/4)]
          if(d_set==num_processor-1):
              dict_data[d_set]=data_final[int(d_set*n/4):]
  
      tasks = dict_data
      results_w=[pool.apply_async(abc,dict_data[t]) for t in range(num_processor)]
      w_f=[]
      for result in results_w:
          w_s=result.get()
          w_f.append(w_s.tolist())
  
      w_f=np.array(w_f)
  
  print (w_f)
  </code></pre>
  
  <p>where tasks is a dictionary with array.</p>
  
  <p><strong>Error:</strong></p>
  
  <p>Can anybody explain the error. I am still not much familiar with the python.</p>
  
  <pre><code>Process ForkPoolWorker-1:
  Process ForkPoolWorker-2:
  Process ForkPoolWorker-3:
  Process ForkPoolWorker-4:
  Traceback (most recent call last):
  Traceback (most recent call last):
    File "/home/anaconda3/lib/python3.5/multiprocessing/process.py", line 254, in _bootstrap
      self.run()
    File "/home/anaconda3/lib/python3.5/multiprocessing/process.py", line 93, in run
      self._target(*self._args, **self._kwargs)
    File "/home/anaconda3/lib/python3.5/multiprocessing/pool.py", line 108, in worker
      task = get()
    File "/home/anaconda3/lib/python3.5/multiprocessing/queues.py", line 345, in get
      return ForkingPickler.loads(res)
    File "/home/anaconda3/lib/python3.5/multiprocessing/process.py", line 254, in _bootstrap
      self.run()
    File "/home/anaconda3/lib/python3.5/multiprocessing/process.py", line 93, in run
      self._target(*self._args, **self._kwargs)
  AttributeError: Can't get attribute 'abc' on &lt;module '__main__' from 'abc_d.py'&gt;
  </code></pre>