title: How to link libraries for python module?
body: <p>I am trying to install a python module called tables, which depends on HDF5. I have installed HDF5 using pkgsrc, so the libraries and headers are in /usr/pkg/lib and /usr/pkg/include, respectively. This is on a Mac (OS 10.9.4).</p>
  
  <p>I am able to install the tables module using pip only if I first export HDF5_DIR=/usr/pkg. That's not a problem in and of itself, but after pip says it has successfully installed tables, I still can't import the module and the error message seems to indicate that it can't find a library related to HDF5. Please see the error message below. I'm guessing that the hint in the error is <code>2): Symbol not found: _H5E_CALLBACK_g</code></p>
  
  <pre><code>In [1]: import tables
  ---------------------------------------------------------------------------
  ImportError                               Traceback (most recent call last)
  &lt;ipython-input-1-389ecae14f10&gt; in &lt;module&gt;()
  ----&gt; 1 import tables
  
  /Users/gregory/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/tables/__init__.py in &lt;module&gt;()
       80 
       81 # Necessary imports to get versions stored on the cython extension
  ---&gt; 82 from tables.utilsextension import (
       83     get_pytables_version, get_hdf5_version, blosc_compressor_list,
       84     blosc_compcode_to_compname_ as blosc_compcode_to_compname,
  
  ImportError: dlopen(/Users/gregory/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/tables/utilsextension.so, 2): Symbol not found: _H5E_CALLBACK_g
    Referenced from: /Users/gregory/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/tables/utilsextension.so
    Expected in: flat namespace
   in /Users/gregory/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/tables/utilsextension.so
  </code></pre>