Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import dataset from search not working #70

Closed
aewindle110 opened this issue May 12, 2020 · 9 comments
Closed

Import dataset from search not working #70

aewindle110 opened this issue May 12, 2020 · 9 comments
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed wontfix This will not be worked on

Comments

@aewindle110
Copy link

  • geemap version: 0.6.0
  • Python version: 3.8.2
  • Operating System: Linux

Description

I am following notebook example 19_search_places_and_datasets.ipynb and am having trouble importing a dataset from the interactive map

What I Did

When I press import after searching for a dataset, nothing happens. The chunk of code does not print under the map. 
@giswqs
Copy link
Member

giswqs commented May 12, 2020

Are you using Jupyter notebook or JupyterLab? Make sure you update geemap to the latest version 0.6.13.

@aewindle110
Copy link
Author

I'm using jupyter lab and just updated geemap to latest version. When I press import, a log entry appears and says "<IPython.core.display.Javascript object>"

@aewindle110
Copy link
Author

I just realized that geemap was not updated. I've run conda install -c conda-forge geemap but when I go to conda list, geemap is still 0.6.10

@giswqs
Copy link
Member

giswqs commented May 12, 2020

It might just be a Jupyter Lab issue. Could you try Jupyter Notebook as well?

@giswqs giswqs added the good first issue Good for newcomers label May 12, 2020
@aewindle110
Copy link
Author

it is working with jupyter notebook. Do you know how to fix with JupyterLab?

@giswqs giswqs added the bug Something isn't working label May 12, 2020
@giswqs
Copy link
Member

giswqs commented May 12, 2020

I will look into it.

@giswqs giswqs added the help wanted Extra attention is needed label May 12, 2020
@giswqs
Copy link
Member

giswqs commented May 12, 2020

The following code is used to create a new cell programmatically. It works in Jupyter notebook, but I am getting an error Javascript Error: IPython is not defined in JupyteLab v2.1.2.

Can some JupyterLab experts help with this? @SylvainCorlay @martinRenou

I also reported this issue on the JupyterLab repo.

def create_code_cell(code='', where='below'):
    """Creates a code cell in the IPython Notebook.

    Args:
        code (str, optional): Code to fill the new code cell with. Defaults to ''.
        where (str, optional): Where to add the new code cell. It can be one of the following: above, below, at_bottom. Defaults to 'below'.
    """

    import base64
    from IPython.display import Javascript, display
    encoded_code = (base64.b64encode(str.encode(code))).decode()
    display(Javascript("""
        var code = IPython.notebook.insert_cell_{0}('code');
        code.set_text(atob("{1}"));
    """.format(where, encoded_code)))

content = 'print("Hello World")'
create_code_cell(code=content)

@SylvainCorlay
Copy link

I also reported this issue on the JupyterLab repo.

Yes, that will never work actually. That piece of code is completely specific to the classic notebook.

@giswqs
Copy link
Member

giswqs commented May 12, 2020

Based on the information I got from here, creating a new cell programmatically with ipywidgets is not supported in JupyterLab. Therefore, there won't be a fix for this. You will have to use Jupyter notebook in this case.

@giswqs giswqs added the wontfix This will not be worked on label May 12, 2020
@giswqs giswqs closed this as completed May 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants