Skip to main content

Dockerfile eo-learn Rtree issue

  • 26 April 2024
  • 0 replies
  • 3 views

Dear Sentinelhub,


After creating a dockerfile for installation (see below for the Dockerfile) for installing the eo-learn package I ran into an error when using geopandas, in specific when trying to perform a spatial join.


My specific code was:
gpd.sjoin(land_cover, gdf, how="inner", op='intersects')


The error I got was:



ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-44-9fb852d609ba> in <module>
----> 1 lc_basilicata_bbox = gpd.sjoin(land_cover, gdf, how="inner", op='intersects')

/usr/local/lib/python3.6/dist-packages/geopandas/tools/sjoin.py in sjoin(left_df, right_df, how, op, lsuffix, rsuffix)
31
32 """
---> 33 import rtree
34
35 if not isinstance(left_df, GeoDataFrame):

ModuleNotFoundError: No module named 'rtree'

Is this a know error? Am i doing wrong in the dockerfile? I didnt get it before when I was running on windows.

Thanks for the help,

Thijs Oosterhuis


Dockerfile:


#Download lastest base image ubuntu

FROM ubuntu:latest

MAINTAINER Matthijs Bernd Oosterhuis


Update Ubuntu Software repository


RUN apt-get update && apt-get install -y software-properties-common

RUN apt-get update && apt-get install -y

build-essential

gdal-bin

geographiclib-tools

libgdal-dev

python3

python3-gdal

python3-pip

python3-numpy-dev

software-properties-common

imagemagick

vim

cmake

unzip

g+±7


RUN pip3 install jupyter
#Install eo-learn package

RUN pip3 install eo-learn


install requirements


CREATE USER


ENV NB_USER jovyan

ENV NB_UID 1000

ENV HOME /home/${NB_USER}


RUN adduser --disabled-password

–gecos “Default user”

–uid ${NB_UID}

${NB_USER}


Make sure the contents of our repo are in ${HOME}


COPY . ${HOME}

USER root

RUN chown -R ${NB_UID} ${HOME}


RUN pip3 install -U pip


switch to user


USER ${NB_USER}

WORKDIR $HOME


#change **** into preferred port

EXPOSE :
#EXPOSE :



#CMD D“jupyterhub-singleuser”]

CMD jupyter notebook --port=**** --ip=0.0.0.0

0 replies

Be the first to reply!

Reply