python27(32位)安装RTree

一开始用pip install -r requirements.txt 报错:OSError: could not find or load spatialindex_c.dll

1)从以下链接下载编译好的spatialindex_c.dll(注意:解压缩后选择与python 位数相同的dll)

libspatialindex-1.8.1-win-msvc-2008-x64-x32.zip

似乎不行。报错:AttributeError: function 'Error_GetLastErrorNum' not found。

2)又从以下链接下载spatialindex源文件:

spatialindex-src-1.8.5-src.tar.gz

3)用VS2013打开编译,选32位编译,生成32位spatialindex_c.dll

4)把这个dll拷贝到C:WindowsSysWOW64文件夹下(因为是WINDOWS 64位OS)。

5)在以下链接下载Rtree whl文件,拷贝到D:Python27目录。

http://www.lfd.uci.edu/~gohlke/pythonlibs/#rtree

Rtree-0.8.2-cp27-cp27m-win32.whl

6)用pip install Rtree-0.8.2-cp27-cp27m-win32.whl安装:Successfully installed Rtree-0.8.2

原文地址:https://www.cnblogs.com/turingbrain/p/5655051.html