Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I install Rtree #146

Closed
devlocalca opened this issue Feb 25, 2020 · 7 comments
Closed

How do I install Rtree #146

devlocalca opened this issue Feb 25, 2020 · 7 comments

Comments

@devlocalca
Copy link

I type: $pip install Rtree , and I get this error message, how do I install Rtree please?

Can someone please send me instructions for installation on:

1. Windows 10
2. RHEL 8.x
3. CentOS 8.x

I need it installed on all three environments please.


PS C:\Users\<user>> pip install Rtree
Collecting Rtree
  Using cached Rtree-0.9.4.tar.gz (62 kB)
    ERROR: Command errored out with exit status 1:
     command: 'c:\apps\python\3.8.1\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\<user>\\AppData\\Local\\Temp\\pip-install-lxb1cib8\\Rtree\\setup.py'"'"'; __file__='"'"'C:\\Users\\<user>\\AppData\\Local\\Temp\\pip-install-lxb1cib8\\Rtree\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\<user>\AppData\Local\Temp\pip-install-lxb1cib8\Rtree\pip-egg-info'
         cwd: C:\Users\<user>\AppData\Local\Temp\pip-install-lxb1cib8\Rtree\
    Complete output (11 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\<user>\AppData\Local\Temp\pip-install-lxb1cib8\Rtree\setup.py", line 3, in <module>
        import rtree
      File "C:\Users\<user>\AppData\Local\Temp\pip-install-lxb1cib8\Rtree\rtree\__init__.py", line 1, in <module>
        from .index import Rtree
      File "C:\Users\<user>\AppData\Local\Temp\pip-install-lxb1cib8\Rtree\rtree\index.py", line 6, in <module>
        from . import core
      File "C:\Users\<user>\AppData\Local\Temp\pip-install-lxb1cib8\Rtree\rtree\core.py", line 126, in <module>
        raise OSError("could not find or load %s" % lib_name)
    OSError: could not find or load spatialindex_c-64.dll
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.```
@ghost
Copy link

ghost commented Mar 3, 2020

Hey,
The error message is confusing.
For me the solution on Ubuntu was to first install libspatialindex
sudo apt install libspatialindex-dev

@FaviG
Copy link

FaviG commented Mar 4, 2020

On Windows I installed this:
conda install -c conda-forge libspatialindex
conda install -c conda-forge rtree

@efojs
Copy link

efojs commented Mar 13, 2020

Came here with same problem, I don't use conda and could not install libspatialindex with pipenv:

# macOS Mojave 10.14.5
# python 3.7.4 (via pyenv)

Error: Command "python setup.py egg_info" failed with error code 1 in /var/folders/r7/2sx1wsvx0gj5x43wkmymg61w0000gq/T/tmpn09357tzbuild/rtree/

Found solution — install spatialindex via Homebrew:

brew install spatialindex

Then pipenv install rtree succeeded and now geopandas works smoothly.
Hope it'll help

@benjaminBrownlee
Copy link

Is there a reason that the conda install isn't working on debian based systems anymore? I have an old conda environment on my Ubuntu machine that has a working installation of rtree but I can't install rtree on a new environment without the apt packages.

@anishpatelwork
Copy link

@efojs this solution worked perfectly for me. Thanks for posting.

@Abeautifulsnow
Copy link

If you are using centos, you can install spatialindex via yum:

sudo yum -y install spatialindex.x86_64 spatialindex-devel.x86_64

And then, you can install rtree successfully.

@hobu
Copy link
Member

hobu commented Dec 22, 2020

Please try 0.9.6 which include libspatialindex builds in wheels

@hobu hobu closed this as completed Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants