0

MacOS Python Rtree installation OSError: dlopen(libspatialindex_c.dylib, 6): image not found.

I followed the instruction on http://toblerity.org/rtree/install.html#nix as below:

First, download and install version 1.7.0 of the libspatialindex library from:

$ ./configure; make; make install

But when I did :

$ pip install Rtree.

I received the following error:

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
MasterAM
  • 16,283
  • 6
  • 45
  • 66
user3610141
  • 305
  • 1
  • 4
  • 14
  • possible duplicate of ["OSError: dlopen(libSystem.dylib, 6): image not found" (OS X + macports + Celery 3.1.7)](http://stackoverflow.com/questions/20915752/oserror-dlopenlibsystem-dylib-6-image-not-found-os-x-macports-celery) – Has QUIT--Anony-Mousse May 07 '14 at 10:37

1 Answers1

1

Looks like the shared library wasn't installed into a directory that python uses for searching. Try to figure out:

  1. Which directory the library was installed to

  2. Which directories are searched by python

  3. How to add the directory from #1 to the list in #2, or which parameters to pass to ./configure to install the library into one of the directorys of #2.

Has QUIT--Anony-Mousse
  • 76,138
  • 12
  • 138
  • 194