0

I would like to begin with geopandas but I have an issue when I import it. Terminal return me this message :

>>>import geopandas
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/geopandas/__init__.py", line 1, in <module>
    from geopandas.geoseries import GeoSeries
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/geopandas/geoseries.py", line 12, in <module>
    from geopandas.base import GeoPandasBase, _series_unary_op, _CoordinateIndexer
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/geopandas/base.py", line 14, in <module>
    from rtree.core import RTreeError
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/rtree/__init__.py", line 1, in <module>
    from .index import Rtree
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/rtree/index.py", line 5, in <module>
    from . import core
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/rtree/core.py", line 125, in <module>
    raise OSError("Could not find libspatialindex_c library file")
OSError: Could not find libspatialindex_c library file

I tried to install spatialindex with pip, brew or directly with github source, and to install again Rtree but it didn't work.

Can somebody help me?

I am on macOS

  • 2
    @robert-tuw , the closure of a question post can be discussed in the chat or the GIS Meta site. The body of the question post seems to me that is not the wright place to do it. – Gabriel De Luca Jan 12 at 18:35
  • @GabrielDeLuca - you may be right, but 1. the first respons to my original post asked me to refine my post in order to correspond to the rules => i was refining the post. and 2. just some hours ago i've got a message which was announcing my account suspension if i would not refrain from "this sort of vandalism" ... i am deeply upset about this unfounded reproach. insulting active members is not a good idea – robert tuw Jan 13 at 9:53
4

You can install libspatialindex using Homebrew. Just run:

brew install spatialindex

  • I already do this brew install spatialindex > Warning: spatialindex 1.8.5 is already installed. And I still have the error – Tim C. Dec 5 '17 at 11:24
  • Try installing Rtree now with easy_install or pip – Hamri Said Dec 5 '17 at 13:06
  • It seems to be already done Requirement already satisfied: Rtree in /opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages Requirement already satisfied: setuptools in /opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages (from Rtree) – Tim C. Dec 5 '17 at 13:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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