OSError:dlopen(libspatialindex_c.dylib,6):找不到图像

时间:2014-05-06 23:09:24

标签: macos python-2.7 installation r-tree

  

MacOS Python Rtree安装OSError:dlopen(libspatialindex_c.dylib,6):找不到图像。

我按照http://toblerity.org/rtree/install.html#nix上的说明进行操作,如下所示:

首先,从以下位置下载并安装 libspatialindex 库的1.7.0版本:

  

$ ./configure;使; make install

但是当我这样做的时候:

  

$ pip install Rtree。

我收到以下错误:

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

1 个答案:

答案 0 :(得分:1)

看起来共享库没有安装到python用于搜索的目录中。试着弄明白:

  1. 将库安装到

  2. 的目录
  3. python

  4. 搜索哪些目录
  5. 如何将#1中的目录添加到#2中的列表,或者将哪些参数传递给./configure以将库安装到#2的某个directorys中。

    < / LI>