Domanda

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
È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top