earthlab-education / ea-bug-queue

EA certificate students: submit minimum reproducible examples of your bugs/problems
0 stars 3 forks source link

Issue Installing geemap/ geemap isn't compatible with Jupyter notebook #5

Open LManak opened 2 years ago

LManak commented 2 years ago

For: @eculler From: @LManak

The Project

Landslide-detect

The Issue

I am having an issue installing geemap.

Geemap doens't seem to be compatible with jupyter notebook. It seems that I have installed it correctly because when I import it on our notebook there are no error messages (and when I create a test map there is a map that pops up, however it is blank). This is what it looks like:

Screen Shot 2022-06-13 at 7 40 11 PM

Is it possible that it needs to be its own fresh environment as they recommend? or does that matter and it's just an issue with jupyter notebook compatibility?

I've looked into it and there are a few solutions in regards to how geemap interacts with jupyter notebook, and I have installed the extension that it requires. Here is how I installed it when I was already in the earth-analytics-python environment:

conda install geemap -c conda-forge conda install jupyter_contrib-nbextensions -c conda-forge jupyter contrib nbextension install --user

I found this useful in regards to the blank map issue, but I am still running into the same problem: https://geemap.org/installation/#install-from-conda-forge.

LManak commented 2 years ago

@eculler

Additionally, I know that there is a package called ipyleaflet that is also recommended to use with jupyter notebook. When I installed this and used: m = ipyleaflet.Map() m

I got a similar blank map return. The body of the map did look different and there were no error messages so I assumed that it worked but only without the actual content of the map.

Thank you!

eculler commented 2 years ago

Hi Leah,

I think maybe you have to enable inline plotting in your notebook, e.g.

%matplotlib inline

Or alternatively, depending on how the plotting is happening:

%pylab inline

(see https://geemap.org/notebooks/surface_water_mapping/#apply-the-algorithm-to-all-images or https://geemap.org/notebooks/51_cartoee_projections/)

Give that a try and let me know if it works (or if you already tried that)