Ipython Notebook: Error in importing module
Question: I am trying to import kabuki module. I installed the module in the terminal
using easy_installation and everything seems in order. But when I import it in
IPython notebook, I get the following error:

    
    
    ImportError: dlopen(/Applications/anaconda/lib/python2.7/site-packages/pymc-2.3.3-py2.7-macosx-10.9-x86_64.egg/pymc/flib.so, 2): Library not loaded: /usr/local/Cellar/gfortran/4.8.2/gfortran/lib/libgfortran.3.dylib
      Referenced from: /Applications/anaconda/lib/python2.7/site-packages/pymc-2.3.3-py2.7-macosx-10.9-x86_64.egg/pymc/flib.so
      Reason: image not found
    

Can anyone help me and tell me how to fix this? I am using mac OS X.

    
    
    ImportError                               Traceback (most recent call last)
    <ipython-input-3-045d55581b72> in <module>()
    ----> 1 import kabuki
    
    /Applications/anaconda/lib/python2.7/site-packages/kabuki-0.5.5-py2.7.egg/kabuki/__init__.py in <module>()
    ----> 1 from hierarchical import *
          2 
          3 import utils
          4 import analyze
          5 import step_methods as steps
    
    /Applications/anaconda/lib/python2.7/site-packages/kabuki-0.5.5-py2.7.egg/kabuki/hierarchical.py in <module>()
         11 
         12 import pandas as pd
    ---> 13 import pymc as pm
         14 import warnings
         15 
    
    /Applications/anaconda/lib/python2.7/site-packages/pymc-2.3.3-py2.7-macosx-10.9-x86_64.egg/pymc/__init__.pyc in <module>()
         28 from .PyMCObjects import *
         29 from .InstantiationDecorators import *
    ---> 30 from .CommonDeterministics import *
         31 from .NumpyDeterministics import *
         32 from .distributions import *
    
    /Applications/anaconda/lib/python2.7/site-packages/pymc-2.3.3-py2.7-macosx-10.9-x86_64.egg/pymc/CommonDeterministics.py in <module>()
         19 import inspect
         20 import types
    ---> 21 from .utils import safe_len, stukel_logit, stukel_invlogit, logit, invlogit, value, find_element
         22 from copy import copy
         23 import sys
    
    /Applications/anaconda/lib/python2.7/site-packages/pymc-2.3.3-py2.7-macosx-10.9-x86_64.egg/pymc/utils.py in <module>()
         12 from copy import copy
         13 from .PyMCObjects import Variable
    ---> 14 from . import flib
         15 import pdb
         16 from numpy.linalg.linalg import LinAlgError
    

Also I am trying to import module hddm and it gives me the following error:

    
    
    ImportError                               Traceback (most recent call last)
    <ipython-input-5-17365318b31c> in <module>()
    ----> 1 import hddm
    
    /Applications/anaconda/lib/python2.7/site-packages/HDDM-0.5.5-py2.7-macosx-10.5-x86_64.egg/hddm/__init__.py in <module>()
          5 __version__ = '0.5.5'
          6 
    ----> 7 import likelihoods
          8 import generate
          9 import utils
    
    /Applications/anaconda/lib/python2.7/site-packages/HDDM-0.5.5-py2.7-macosx-10.5-x86_64.egg/hddm/likelihoods.py in <module>()
          1 from __future__ import division
    ----> 2 import pymc as pm
          3 import numpy as np
          4 from scipy import stats
          5 
    
    /Applications/anaconda/lib/python2.7/site-packages/pymc-2.3.3-py2.7-macosx-10.9-x86_64.egg/pymc/__init__.pyc in <module>()
         28 from .PyMCObjects import *
         29 from .InstantiationDecorators import *
    ---> 30 from .CommonDeterministics import *
         31 from .NumpyDeterministics import *
         32 from .distributions import *
    
    /Applications/anaconda/lib/python2.7/site-packages/pymc-2.3.3-py2.7-macosx-10.9-x86_64.egg/pymc/CommonDeterministics.py in <module>()
         11 __docformat__ = 'reStructuredText'
         12 
    ---> 13 from . import PyMCObjects as pm
         14 from .Node import Variable
         15 from .Container import Container
    
    ImportError: cannot import name PyMCObjects
    


Answer: As the error message says and [the install documentation hinted](https://pymc-
devs.github.io/pymc/INSTALL.html#dependencies), you need Fortran library if
you compile PyMC from source. In this case, it's looking for [gfortran
library](https://gcc.gnu.org/wiki/GFortranBinariesMacOS).

