title: OSError: dlopen(libspatialindex_c.dylib, 6): image not found
body: <blockquote>
    <p>MacOS Python Rtree installation OSError: dlopen(libspatialindex_c.dylib, 6): image not found.  </p>
  </blockquote>
  
  <p>I followed the instruction on <a href="http://toblerity.org/rtree/install.html#nix" rel="nofollow">http://toblerity.org/rtree/install.html#nix</a> as below:</p>
  
  <p>First, download and install version 1.7.0 of the <em>libspatialindex</em> library from:</p>
  
  <blockquote>
    <p>$ ./configure; make; make install</p>
  </blockquote>
  
  <p>But when I did :</p>
  
  <blockquote>
    <p>$ pip install Rtree.</p>
  </blockquote>
  
  <p>I received the following error:</p>
  
  <pre>
  Downloading/unpacking rtree
    Downloading Rtree-0.7.0.tar.gz (44kB): 44kB downloaded
    Running setup.py (path:/private/var/folders/zv/1hqhxh0n6m374cwzysmdn6zc0000gn/T/pip_build_bdcoe/rtree/setup.py) egg_info for package rtree
      Traceback (most recent call last):
        File "", line 17, in 
        File "/private/var/folders/zv/1hqhxh0n6m374cwzysmdn6zc0000gn/T/pip_build_bdcoe/rtree/setup.py", line 5, in 
          import rtree
        File "rtree/__init__.py", line 1, in 
          from index import Rtree
        File "rtree/index.py", line 2, in 
          import core
        File "rtree/core.py", line 85, in 
          rt = ctypes.CDLL(lib_name)
        File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 365, in __init__
          self._handle = _dlopen(self._name, mode)
      OSError: dlopen(libspatialindex_c.dylib, 6): image not found
      Complete output from command python setup.py egg_info:
      Traceback (most recent call last):
  
    File "", line 17, in 
  
    File "/private/var/folders/zv/1hqhxh0n6m374cwzysmdn6zc0000gn/T/pip_build_bdcoe/rtree/setup.py", line 5, in 
  
      import rtree
  
    File "rtree/__init__.py", line 1, in 
  
      from index import Rtree
  
    File "rtree/index.py", line 2, in 
  
      import core
  
    File "rtree/core.py", line 85, in 
  
      rt = ctypes.CDLL(lib_name)
  
    File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ctypes/__init__.py", line 365, in __init__
  
      self._handle = _dlopen(self._name, mode)
  
  OSError: dlopen(libspatialindex_c.dylib, 6): image not found
  
  ----------------------------------------
  Cleaning up...
  Command python setup.py egg_info failed with error code 1 in /private/var/folders/zv/1hqhxh0n6m374cwzysmdn6zc0000gn/T/pip_build_bdcoe/rtree
  Storing debug log for failure in /Users/bdcoe/Library/Logs/pip.log
  </pre>