why can't I import geopandas?

后端 未结 4 1520
借酒劲吻你
借酒劲吻你 2021-02-05 05:53

My only line of code is

import geopandas

and it gives me the error

OSError: Could not find libspatialindex_c library file
         


        
4条回答
  •  时光说笑
    2021-02-05 06:00

    If you are using MacOS, it's as simple as follow:

    brew install spatialindex
    pip install rtree
    

    If you are working on linux environment you have to build this from source:

    1. Install spatialindex

      curl -L https://github.com/libspatialindex/libspatialindex/archive/1.8.5.tar.gz | tar xz
      cd libspatialindex-1.8.5/
      ./autogen.sh
      ./configure
      make
      sudo make install
      sudo ldconfig
      
    1. install rtree: pip install rtree

提交回复
热议问题