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

Cell Execution feature for Notebooks #3

Open
Prahmodh-Raj1 opened this issue Jun 28, 2024 · 9 comments
Open

Cell Execution feature for Notebooks #3

Prahmodh-Raj1 opened this issue Jun 28, 2024 · 9 comments

Comments

@Prahmodh-Raj1
Copy link

I'm currently unable to run the cells in the Notebook, that is being rendered in the React Application.

Link to the code: https://github.com/Prahmodh-Raj1/Jupyter-UI-Test

Terminal Error (on clicking the Run button of the cell):
Requesting cell execution without any cell executor defined. Falling back to default execution.

Kindly help me resolve this issue. cc @echarles

@echarles
Copy link
Contributor

Just tried and have a few questions/comments.

  • Which packager are you using ? (yarn, npm...)
  • You need to defined resolutions for yarn
    "resolutions": {
    "@jupyter-widgets/base": "6.0.6",
    "@jupyter-widgets/controls": "5.0.7",
    "@jupyter-widgets/html-manager": "1.0.9",
    "@jupyter-widgets/jupyterlab-manager": "5.0.9",
    "@jupyter-widgets/output": "6.0.6",
    "@jupyterlab/application": "4.1.0-beta.0",
    "@jupyterlab/apputils": "4.2.0-beta.0",
    "@jupyterlab/attachments": "4.1.0-beta.0",
    "@jupyterlab/cells": "4.1.0-beta.0",
    "@jupyterlab/codeeditor": "4.1.0-beta.0",
    "@jupyterlab/codemirror": "4.1.0-beta.0",
    "@jupyterlab/completer": "4.1.0-beta.0",
    "@jupyterlab/console": "4.1.0-beta.0",
    "@jupyterlab/coreutils": "6.1.0-beta.0",
    "@jupyterlab/docmanager": "4.1.0-beta.0",
    "@jupyterlab/docregistry": "4.1.0-beta.0",
    "@jupyterlab/documentsearch": "4.1.0-beta.0",
    "@jupyterlab/filebrowser": "4.1.0-beta.0",
    "@jupyterlab/fileeditor": "4.1.0-beta.0",
    "@jupyterlab/inspector": "4.1.0-beta.0",
    "@jupyterlab/javascript-extension": "4.1.0-beta.0",
    "@jupyterlab/json-extension": "4.1.0-beta.0",
    "@jupyterlab/launcher": "4.1.0-beta.0",
    "@jupyterlab/lsp": "4.1.0-beta.0",
    "@jupyterlab/mainmenu": "4.1.0-beta.0",
    "@jupyterlab/markdownviewer": "4.1.0-beta.0",
    "@jupyterlab/markedparser-extension": "4.1.0-beta.0",
    "@jupyterlab/mathjax-extension": "4.1.0-beta.0",
    "@jupyterlab/nbconvert-css": "4.1.0-beta.0",
    "@jupyterlab/nbformat": "4.1.0-beta.0",
    "@jupyterlab/notebook": "4.1.0-beta.0",
    "@jupyterlab/observables": "5.1.0-beta.0",
    "@jupyterlab/outputarea": "4.1.0-beta.0",
    "@jupyterlab/rendermime": "4.1.0-beta.0",
    "@jupyterlab/rendermime-extension": "4.1.0-beta.0",
    "@jupyterlab/rendermime-interfaces": "3.9.0-beta.0",
    "@jupyterlab/services": "7.1.0-beta.0",
    "@jupyterlab/settingregistry": "4.1.0-beta.0",
    "@jupyterlab/statedb": "4.1.0-beta.0",
    "@jupyterlab/terminal": "4.1.0-beta.0",
    "@jupyterlab/theme-dark-extension": "4.1.0-beta.0",
    "@jupyterlab/theme-light-extension": "4.1.0-beta.0",
    "@jupyterlab/translation": "4.1.0-beta.0",
    "@jupyterlab/ui-components": "4.1.0-beta.0",
    "@jupyterlite/server": "0.2.2",
    "@jupyterlite/server-extension": "0.2.2",
    "@jupyter/ydoc": "1.1.1",
    "@lumino/algorithm": "2.0.1",
    "@lumino/application": "2.2.0",
    "@lumino/collections": "2.0.1",
    "@lumino/commands": "2.2.0",
    "@lumino/coreutils": "2.1.1",
    "@lumino/default-theme": "2.1.2",
    "@lumino/disposable": "2.1.1",
    "@lumino/domutils": "2.0.1",
    "@lumino/dragdrop": "2.1.2",
    "@lumino/keyboard": "2.0.1",
    "@lumino/messaging": "2.0.1",
    "@lumino/polling": "2.1.1",
    "@lumino/properties": "2.0.1",
    "@lumino/signaling": "2.1.1",
    "@lumino/virtualdom": "2.0.1",
    "@lumino/widgets": "2.3.1",
    "@rjsf/core": "5.3.0",
    "@rjsf/utils": "5.3.0",
    "@rjsf/validator-ajv6": "5.3.0",
    "@rjsf/validator-ajv8": "5.3.0",
    "@types/react": "18.2.12",
    "@types/react-dom": "18.2.5",
    "@jest/core": "29.4.3",
    "@jest/transform": "29.4.3",
    "jest": "29.4.3",
    "jest-environment-jsdom": "29.4.3",
    "ts-jest": "29.0.5",
    "html-webpack-plugin": "5.3.1",
    "htmlparser2": "8.0.1",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-redux": "8.1.2",
    "redux": "4.1.0",
    "redux-observable": "1.2.0",
    "rxjs": "6.6.0",
    "styled-components": "5.3.10",
    "typescript": "5.0.3",
    "webpack": "5.74.0",
    "webpack-cli": "4.10.0",
    "webpack-dev-server": "4.9.3",
    "y-websocket": "1.4.5",
    "yjs": "13.5.47",
    "zustand": "4.4.1"
    },

But it looks like you are building and running, so maybe just force reload your browser, it may help to solve the issue you reported.

@Prahmodh-Raj1
Copy link
Author

I'm using npm to install the dependencies, and 'npm start' to start the cra application. @echarles

@Prahmodh-Raj1
Copy link
Author

And is the current content of the App.tsx file enough to get the cells executing? Or should I need to add some other components too?

const App(()=>{

  const [tab, setTab] = useState(0);
  return (
    <>
      <Box>
        <Jupyter startDefaultKernel={true}>
              <Notebook
                path="Documents/Sample.ipynb"
                CellSidebar={CellSidebarRun}
              />
        </Jupyter>
      </Box>
    </>
  );
});

@echarles
Copy link
Contributor

If you see the Notebook, that should be enough. Can you bumpt to 0.11.0? Any errors in the devtools console?

@Prahmodh-Raj1
Copy link
Author

I tried updating to version 0.11.0, but i'm facing the following error when I execute the "npm install" command:

`

npm install
npm notice 
npm notice New minor version of npm available! 10.5.2 -> 10.8.1
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.1
npm notice Run npm install -g [email protected] to update!
npm notice 
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: @types/[email protected]
npm ERR! node_modules/@types/react
npm ERR!   dev @types/react@"18.0.27" from the root project
npm ERR!   peerOptional @types/react@"^18.0.0" from @primer/[email protected]
npm ERR!   node_modules/@datalayer/primer-addons/node_modules/@primer/react
npm ERR!     @primer/react@"36.6.0" from @datalayer/[email protected]
npm ERR!     node_modules/@datalayer/primer-addons
npm ERR!       @datalayer/primer-addons@"0.3.0" from the root project
npm ERR!       1 more (@datalayer/jupyter-react)
npm ERR!   9 more (@jupyterlab/apputils, @primer/react, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peerOptional @types/react@"^18.2.25" from [email protected]
npm ERR! node_modules/react-redux
npm ERR!   react-redux@"^9.1.2" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: @types/[email protected]
npm ERR! node_modules/@types/react
npm ERR!   peerOptional @types/react@"^18.2.25" from [email protected]
npm ERR!   node_modules/react-redux
npm ERR!     react-redux@"^9.1.2" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! 
npm ERR! For a full report see:
npm ERR! /Users/xyz/.npm/_logs/2024-06-28T08_32_52_492Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: /Users/xyz/.npm/_logs/2024-06-28T08_32_52_492Z-debug-0.log

@Prahmodh-Raj1
Copy link
Author

Prahmodh-Raj1 commented Jun 28, 2024

If you see the Notebook, that should be enough. Can you bumpt to 0.11.0? Any errors in the devtools console?

This is the error in the devtools console: @echarles

Requesting cell execution without any cell executor defined. Falling back to default execution.

@echarles
Copy link
Contributor

@Prahmodh-Raj1 I have release jupyter-react 0.12.0 and pushed 3e05847 to update the example

On my env, the latest example works fine with both yarn and npm.

Can you try that?, hopefully it should fix the issue (which is linked to mixed non-compatible versions of jupyterlab, hence I have removed the constraints on the resolutions).

@Prahmodh-Raj1
Copy link
Author

Prahmodh-Raj1 commented Jun 28, 2024

The cell execution is still failing in spite of updating the application with the latest commit: 3e05847.

The devtools console still produces the same error:
Requesting cell execution without any cell executor defined. Falling back to default execution.

It would be great if you could please share another repo where the cell execution has been tested? @echarles

image

@echarles
Copy link
Contributor

It would be great if you could please share another repo where the cell execution has been tested? @echarles

Thx again for tyring @Prahmodh-Raj1 The safest is to clone from zero https://github.com/datalayer-examples/jupyter-react-cra-example and use yarn to build/start (did a check also with npm and worked fine on my side).

If you still have the issue, this will probably come from non coherent juptyerlab packages in your node_modules (you would have to force them via resolutions).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants