I am deploying a python script in a EC2 server running a redhat linux variant. I'm trying to install geopandas dependencies libspatialindex and rtree
I followed the instructions to install libspatialindex:
$cmake -DCMAKE_INSTALL_PREFIX=/home/ec2-user/
$make
$make install
and it creates two folders: include
and lib
. lib
contains libspatialindex_c.so.4
but I have no idea how to correctly reference this folder or where it should be located. I read that the LD_LIBRARY_PATH
could be set in the bash profile but I had no luck with this. I did this: LD_LIBRARY_PATH=/home/ec2-user/lib
, which doesn't seem right but it did not do anything.
My current PATH
is set to PATH=$PATH:$HOME/.local/bin:$HOME/bin
When do I get this error?
pip3 install --user rtree
OSError: libspatialindex_c.so.4: cannot open shared object file: No such file or directory
This suggests using an older version of rtree
pip install "rtree>=0.8,<0.9"
. There's no error in installation but then this ends up happening:
>>>import rtree
OSError: libspatialindex_c.so.4: cannot open shared object file: No such file or directory
>>import geopandas
OSError: libspatialindex_c.so.4: cannot open shared object file: No such file or directory
why can't I import geopandas? was a similar problem and got me to this point. I have libspatialindex_c.so.4
but I need to know where to place this file. I have other scripts on this instance, so anaconda is not a solution. I tried to install linuxbrew but there were other problems with that.