title: How to solve the loading error of clang's Python binding?
body: <p>I'm trying the Python binding for clang. I installed LLVM and its python bindings using <code>homebrew</code> on Mac OS X Maverics with command line</p>
  
  <pre><code> brew install llvm --with-clang --with-python --with-lld
  </code></pre>
  
  <p>The loading code is</p>
  
  <pre><code>import clang
  import clang.cindex
  
  clang.cindex.Config.set_library_path('/usr/local/Cellar/llvm/3.5.0/lib')
  index = clang.cindex.Index.create()
  </code></pre>
  
  <p>But this throws an error: </p>
  
  <blockquote>
    <p>clang.cindex.LibclangError:
    dlopen(/usr/local/Cellar/llvm/3.5.0/lib/libclang.dylib, 6): Library
    not loaded: @rpath/libLLVM-3.5.dylib   Referenced from:
    /usr/local/Cellar/llvm/3.5.0/lib/libclang.dylib   Reason: image not
    found. To provide a path to libclang use Config.set_library_path() or
    Config.set_library_file().</p>
  </blockquote>
  
  <p>But I don't understand why this error occurs. Doesn't <code>@rpath</code> here refers to <code>/usr/local/Cellar/llvm/3.5.0/lib</code>? But there <em>is</em> a file called <code>libLLVM-3.5.dylib</code> under that directory. Why does this loading cause an error and how to fix it?</p>