title: Attribute Error When Pandas and Multiprocessing Modules Are Both Used
body: <p>I am fairly new to Python and am building an application that queries a database in a background process and then sticks the results in a pandas dataset for some analysis. I can get the analysis and querying sections working fine independently; however, when I combine my code I get the following error (which keeps repeating until I kill the program): </p>
  
  <pre><code>'module' object has no attribute 'day_abbr'
  'module' object has no attribute 'day_abbr'
  'module' object has no attribute 'day_abbr'
  'module' object has no attribute 'day_abbr'
  Traceback (most recent call last):
    File "&lt;string&gt;", line 1, in &lt;module&gt;
    File "C:\Users\z083423\AppData\Local\Continuum\Anaconda\lib\multiprocessing\forking.py", line 380, in main
      prepare(preparation_data)
    File "C:\Users\z083423\AppData\Local\Continuum\Anaconda\lib\multiprocessing\forking.py", line 495, in prepare
      '__parents_main__', file, path_name, etc
    File "G:\Stress Test\PPNR Models\Model_Management_App\Model_Mgnt_Proj\ModelMgntMainDeleteThis.py", line 5, in &lt;module&gt;
      import pandas as pd
    File "C:\Users\z083423\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\__init__.py", line 6, in &lt;module&gt;
      from . import hashtable, tslib, lib
    File "tslib.pyx", line 3744, in init pandas.tslib (pandas\tslib.c:66221)
    File "tslib.pyx", line 3662, in pandas.tslib.TimeRE.__init__ (pandas\tslib.c:53412)
    File "tslib.pyx", line 3545, in pandas.tslib.LocaleTime.__init__ (pandas\tslib.c:51221)
    File "tslib.pyx", line 3565, in pandas.tslib.LocaleTime.__calc_weekday (pandas\tslib.c:51571)
  AttributeError: 'module' object has no attribute 'day_abbr'
  Traceback (most recent call last):
    File "&lt;string&gt;", line 1, in &lt;module&gt;
    File "C:\Users\z083423\AppData\Local\Continuum\Anaconda\lib\multiprocessing\forking.py", line 380, in main
      prepare(preparation_data)
    File "C:\Users\z083423\AppData\Local\Continuum\Anaconda\lib\multiprocessing\forking.py", line 495, in prepare
      '__parents_main__', file, path_name, etc
    File "G:\Stress Test\PPNR Models\Model_Management_App\Model_Mgnt_Proj\ModelMgntMainDeleteThis.py", line 5, in &lt;module&gt;
      import pandas as pd
    File "C:\Users\z083423\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\__init__.py", line 6, in &lt;module&gt;
      from . import hashtable, tslib, lib
    File "tslib.pyx", line 3744, in init pandas.tslib (pandas\tslib.c:66221)
    File "tslib.pyx", line 3662, in pandas.tslib.TimeRE.__init__ (pandas\tslib.c:53412)
    File "tslib.pyx", line 3545, in pandas.tslib.LocaleTime.__init__ (pandas\tslib.c:51221)
    File "tslib.pyx", line 3565, in pandas.tslib.LocaleTime.__calc_weekday (pandas\tslib.c:51571)
  AttributeError: 'module' object has no attribute 'day_abbr'
  Traceback (most recent call last):
    File "&lt;string&gt;", line 1, in &lt;module&gt;
    File "C:\Users\z083423\AppData\Local\Continuum\Anaconda\lib\multiprocessing\forking.py", line 380, in main
      prepare(preparation_data)
    File "C:\Users\z083423\AppData\Local\Continuum\Anaconda\lib\multiprocessing\forking.py", line 495, in prepare
      '__parents_main__', file, path_name, etc
    File "G:\Stress Test\PPNR Models\Model_Management_App\Model_Mgnt_Proj\ModelMgntMainDeleteThis.py", line 5, in &lt;module&gt;
      import pandas as pd
    File "C:\Users\z083423\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\__init__.py", line 6, in &lt;module&gt;
      from . import hashtable, tslib, lib
    File "tslib.pyx", line 3744, in init pandas.tslib (pandas\tslib.c:66221)
    File "tslib.pyx", line 3662, in pandas.tslib.TimeRE.__init__ (pandas\tslib.c:53412)
    File "tslib.pyx", line 3545, in pandas.tslib.LocaleTime.__init__ (pandas\tslib.c:51221)
    File "tslib.pyx", line 3565, in pandas.tslib.LocaleTime.__calc_weekday (pandas\tslib.c:51571)
  AttributeError: 'module' object has no attribute 'day_abbr'
  Traceback (most recent call last):
    File "&lt;string&gt;", line 1, in &lt;module&gt;
    File "C:\Users\z083423\AppData\Local\Continuum\Anaconda\lib\multiprocessing\forking.py", line 380, in main
      prepare(preparation_data)
    File "C:\Users\z083423\AppData\Local\Continuum\Anaconda\lib\multiprocessing\forking.py", line 495, in prepare
      '__parents_main__', file, path_name, etc
    File "G:\Stress Test\PPNR Models\Model_Management_App\Model_Mgnt_Proj\ModelMgntMainDeleteThis.py", line 5, in &lt;module&gt;
      import pandas as pd
    File "C:\Users\z083423\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\__init__.py", line 6, in &lt;module&gt;
      from . import hashtable, tslib, lib
    File "tslib.pyx", line 3744, in init pandas.tslib (pandas\tslib.c:66221)
    File "tslib.pyx", line 3662, in pandas.tslib.TimeRE.__init__ (pandas\tslib.c:53412)
    File "tslib.pyx", line 3545, in pandas.tslib.LocaleTime.__init__ (pandas\tslib.c:51221)
    File "tslib.pyx", line 3565, in pandas.tslib.LocaleTime.__calc_weekday (pandas\tslib.c:51571)
  AttributeError: 'module' object has no attribute 'day_abbr'
  'module' object has no attribute 'day_abbr'
  'module' object has no attribute 'day_abbr'
  'module' object has no attribute 'day_abbr'
  'module' object has no attribute 'day_abbr'
  Traceback (most recent call last):
    File "&lt;string&gt;", line 1, in &lt;module&gt;
    File "C:\Users\z083423\AppData\Local\Continuum\Anaconda\lib\multiprocessing\forking.py", line 380, in main
      prepare(preparation_data)
    File "C:\Users\z083423\AppData\Local\Continuum\Anaconda\lib\multiprocessing\forking.py", line 495, in prepare
      '__parents_main__', file, path_name, etc
    File "G:\Stress Test\PPNR Models\Model_Management_App\Model_Mgnt_Proj\ModelMgntMainDeleteThis.py", line 5, in &lt;module&gt;
      import pandas as pd
    File "C:\Users\z083423\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\__init__.py", line 6, in &lt;module&gt;
      from . import hashtable, tslib, lib
    File "tslib.pyx", line 3744, in init pandas.tslib (pandas\tslib.c:66221)
    File "tslib.pyx", line 3662, in pandas.tslib.TimeRE.__init__ (pandas\tslib.c:53412)
    File "tslib.pyx", line 3545, in pandas.tslib.LocaleTime.__init__ (pandas\tslib.c:51221)
    File "tslib.pyx", line 3565, in pandas.tslib.LocaleTime.__calc_weekday (pandas\tslib.c:51571)
  AttributeError: 'module' object has no attribute 'day_abbr'
  Traceback (most recent call last):
    File "&lt;string&gt;", line 1, in &lt;module&gt;
    File "C:\Users\z083423\AppData\Local\Continuum\Anaconda\lib\multiprocessing\forking.py", line 380, in main
      prepare(preparation_data)
    File "C:\Users\z083423\AppData\Local\Continuum\Anaconda\lib\multiprocessing\forking.py", line 495, in prepare
      '__parents_main__', file, path_name, etc
    File "G:\Stress Test\PPNR Models\Model_Management_App\Model_Mgnt_Proj\ModelMgntMainDeleteThis.py", line 5, in &lt;module&gt;
      import pandas as pd
    File "C:\Users\z083423\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\__init__.py", line 6, in &lt;module&gt;
      from . import hashtable, tslib, lib
    File "tslib.pyx", line 3744, in init pandas.tslib (pandas\tslib.c:66221)
    File "tslib.pyx", line 3662, in pandas.tslib.TimeRE.__init__ (pandas\tslib.c:53412)
    File "tslib.pyx", line 3545, in pandas.tslib.LocaleTime.__init__ (pandas\tslib.c:51221)
    File "tslib.pyx", line 3565, in pandas.tslib.LocaleTime.__calc_weekday (pandas\tslib.c:51571)
  AttributeError: 'module' object has no attribute 'day_abbr'
  Traceback (most recent call last):
    File "&lt;string&gt;", line 1, in &lt;module&gt;
    File "C:\Users\z083423\AppData\Local\Continuum\Anaconda\lib\multiprocessing\forking.py", line 380, in main
      prepare(preparation_data)
    File "C:\Users\z083423\AppData\Local\Continuum\Anaconda\lib\multiprocessing\forking.py", line 495, in prepare
      '__parents_main__', file, path_name, etc
    File "G:\Stress Test\PPNR Models\Model_Management_App\Model_Mgnt_Proj\ModelMgntMainDeleteThis.py", line 5, in &lt;module&gt;
      import pandas as pd
    File "C:\Users\z083423\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\__init__.py", line 6, in &lt;module&gt;
      from . import hashtable, tslib, lib
    File "tslib.pyx", line 3744, in init pandas.tslib (pandas\tslib.c:66221)
    File "tslib.pyx", line 3662, in pandas.tslib.TimeRE.__init__ (pandas\tslib.c:53412)
    File "tslib.pyx", line 3545, in pandas.tslib.LocaleTime.__init__ (pandas\tslib.c:51221)
    File "tslib.pyx", line 3565, in pandas.tslib.LocaleTime.__calc_weekday (pandas\tslib.c:51571)
  AttributeError: 'module' object has no attribute 'day_abbr'
  Traceback (most recent call last):
    File "&lt;string&gt;", line 1, in &lt;module&gt;
    File "C:\Users\z083423\AppData\Local\Continuum\Anaconda\lib\multiprocessing\forking.py", line 380, in main
      prepare(preparation_data)
    File "C:\Users\z083423\AppData\Local\Continuum\Anaconda\lib\multiprocessing\forking.py", line 495, in prepare
      '__parents_main__', file, path_name, etc
    File "G:\Stress Test\PPNR Models\Model_Management_App\Model_Mgnt_Proj\ModelMgntMainDeleteThis.py", line 5, in &lt;module&gt;
      import pandas as pd
    File "C:\Users\z083423\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\__init__.py", line 6, in &lt;module&gt;
      from . import hashtable, tslib, lib
    File "tslib.pyx", line 3744, in init pandas.tslib (pandas\tslib.c:66221)
    File "tslib.pyx", line 3662, in pandas.tslib.TimeRE.__init__ (pandas\tslib.c:53412)
    File "tslib.pyx", line 3545, in pandas.tslib.LocaleTime.__init__ (pandas\tslib.c:51221)
    File "tslib.pyx", line 3565, in pandas.tslib.LocaleTime.__calc_weekday (pandas\tslib.c:51571)
  AttributeError: 'module' object has no attribute 'day_abbr'
  'module' object has no attribute 'day_abbr'
  Traceback (most recent call last):
    File "&lt;string&gt;", line 1, in &lt;module&gt;
    File "C:\Users\z083423\AppData\Local\Continuum\Anaconda\lib\multiprocessing\forking.py", line 380, in main
      prepare(preparation_data)
    File "C:\Users\z083423\AppData\Local\Continuum\Anaconda\lib\multiprocessing\forking.py", line 495, in prepare
      '__parents_main__', file, path_name, etc
    File "G:\Stress Test\PPNR Models\Model_Management_App\Model_Mgnt_Proj\ModelMgntMainDeleteThis.py", line 5, in &lt;module&gt;
      import pandas as pd
    File "C:\Users\z083423\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\__init__.py", line 6, in &lt;module&gt;
      from . import hashtable, tslib, lib
    File "tslib.pyx", line 3744, in init pandas.tslib (pandas\tslib.c:66221)
    File "tslib.pyx", line 3662, in pandas.tslib.TimeRE.__init__ (pandas\tslib.c:53412)
    File "tslib.pyx", line 3545, in pandas.tslib.LocaleTime.__init__ (pandas\tslib.c:51221)
    File "tslib.pyx", line 3565, in pandas.tslib.LocaleTime.__calc_weekday (pandas\tslib.c:51571)
  AttributeError: 'module' object has no attribute 'day_abbr'
  </code></pre>
  
  <p>From everything I've read is may be a namespace error where I'm importing modules that have attributes that share the same name. I have narrowed it down to my import of the pandas and multiprocessing modules (i.e. if I do it with one, but not the other it works fine). There are many examples online that successfully import both these modules. I can run these examples; however, when I try to do something custom, I can't get it to work. I'm sure I'm missing something. Below is an example of some code that gives me the error. Any help would be very appreciated! </p>
  
  <pre><code>import wx
  import time
  
  import sys
  
  import pandas as pd
  import multiprocessing as mp
  
  def Worker():
      time.sleep(3)
      return [(1,2),(2,3),(4,5)]
  
  class TheApp(wx.App):
       def OnInit(self):
           mainFrame = MainFrame(None, 'Test')
           mainFrame.Show()
           return True
  
  class MainFrame(wx.Frame):
  
      def __init__(self, theParent, theTitle):
          wx.Frame.__init__(self, parent=theParent, title=theTitle, size=(200,200))
          self.Centre()
          myPanel = wx.Panel(self)
          self.myLabel = wx.StaticText(myPanel, -1, label="Start")
  
          pool = mp.Pool(4)
          pool.apply_async(func=Worker, callback=self.CallBackFunc)       
  
          #self.CallBackFunc([(1,2),(2,3),(4,5)])
  
      def CallBackFunc(self, returnValue):
          reader = pd.DataFrame.from_records(returnValue)
          self.myLabel.SetLabel(str(reader.get_value(1,1,True)))
          self.Refresh()           
  
  if __name__ == "__main__":
      app = TheApp(False)
      app.MainLoop()
      sys.exit(0)
  </code></pre>