I need to use Rtrees to make some code I'm running faster. However, in order to use Rtree, I need to install libspatialindex. When I've installed packages in the past I've been able to either download a .exe file from Chris Gohlke's site, or use setup.py install from the command prompt, after extracting the contents of a tar.gz file.

The problem I'm having is that 1.) There is no .exe file on Gohlke's site, and 2.) After downloading 'spatialindex-src-1.8.4.tar', and trying to extract it, I get the error 'Can not create output directory' - I have no idea what that's all about. 3.) I go to http://download.osgeo.org/libspatialindex/ and download the appropriate file - i.e. libspatialindex-1.8.1-win-msvc-2010-x64-x32.zip, when I unzip it seems obvious that everything I need is there - there are a number of .dll files. It seems like this last one is the best route, but after unzipping, I don't know what to do with all the files. Do they need to do into my DLLs folder?

2 Answers 2


Not really sure but libspatialindex is only a C library (low level).

You should just need to use the Rtree Windows installer, a Python package using libspatialindex on the top.

In fact, since we answered, the install process has changed. You need to get a remote URL to a file ending with .whl (for "wheel", a new Python packaging way to ease installation) or you can download the file and install from it.

Then, you will do from command line:

# Install from remote ressource
pip install http://www.lfd.uci.edu/~gohlke/pythonlibs/djcobkfp/Rtree-0.8.2-cp27-cp27m-win_amd64.whl
# Or for local downloaded file
pip install Rtree-0.8.2-cp27-cp27m-win_amd64.whl

We know what we are installing because of file name convention:

  • Rtree-0.8.2 = Rtree version 0.8.2
  • cp27-cp27m = Version of Python = 2.7
  • win_amd64 = Windows 64 bits architecture

For installation, you can also use this page from official docs.

  • When I run set.py install for the Rtree module from my command prompt, I get could not find or load spatialindex_c.dll, so I was assuming I needed to install it. I have a files called spatialindex_c-32.dll that came with my 'libspatialindex-1.8.1-win-msvc-2010-x64-x32.zip' download. I was thinking maybe I just need to put is where the installer is looking?
    – CSB
    Oct 31, 2014 at 18:02
  • Why did you not download the RTree installer in the first link? It's a Windows installer. I edited my answer to make it more clear.
    – ThomasG77
    Oct 31, 2014 at 21:34
  • Thanks! I saw in the documentation that you first need to install libspatialindex. So, naturally I tried installing that first - but to no avail. And, on the Rtree site they offer the tar ball for install, so I tried to go through that in the command prompt, which threw my the error listed abover. I ended up going to the Gohlke site and all appears to be working fine now.
    – CSB
    Oct 31, 2014 at 22:14

You could try the installation with conda instead of pip.

conda install -c conda-forge cenpy

See the CenPy documentation: https://pypi.org/project/cenpy/

You don't need to separately install geopandas and Rtree if you use conda.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.