Git Product home page Git Product logo

Comments (9)

giswqs avatar giswqs commented on May 22, 2024 1

I will look into it.

from geemap.

giswqs avatar giswqs commented on May 22, 2024

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

from geemap.

aewindle110 avatar aewindle110 commented on May 22, 2024

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>"

from geemap.

aewindle110 avatar aewindle110 commented on May 22, 2024

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

from geemap.

giswqs avatar giswqs commented on May 22, 2024

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

from geemap.

aewindle110 avatar aewindle110 commented on May 22, 2024

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

from geemap.

giswqs avatar giswqs commented on May 22, 2024

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)

from geemap.

SylvainCorlay avatar SylvainCorlay commented on May 22, 2024

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.

from geemap.

giswqs avatar giswqs commented on May 22, 2024

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.

from geemap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.