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

Jupyter Notebooks not working #3782

Closed
benz0li opened this issue Jul 15, 2021 · 74 comments · Fixed by coder/vscode#30 or coder/vscode#40
Closed

Jupyter Notebooks not working #3782

benz0li opened this issue Jul 15, 2021 · 74 comments · Fixed by coder/vscode#30 or coder/vscode#40
Assignees
Labels
bug Something isn't working needs-investigation This issue needs to be further investigated
Milestone

Comments

@benz0li
Copy link
Contributor

benz0li commented Jul 15, 2021

OS/Web Information

  • Web Browser: Firefox 89.0.2 (64-bit)
  • Local OS: macOS 10.14.6 (Mojave)
  • Remote OS: Debian buster
  • Remote Architecture: 64-bit
  • code-server --version: 3.11.0 4e8cd09

Steps to Reproduce

  • Create a .ipynb file

Expected

Jupyter extension should load and display the Jupyter notebook.

Actual

jupyter_error

Logs

Log (Remote Extension Host)

[2021-07-15 07:06:36.925] [exthost] [error] Activating extension ms-toolsai.jupyter failed due to an error:
[2021-07-15 07:06:36.925] [exthost] [error] Error: Cannot find module '/home/jovyan/.local/share/code-server/extensions/ms-toolsai.jupyter-2021.6.99/out/client/extension'
Require stack:
- /opt/code-server/lib/vscode/out/vs/loader.js
- /opt/code-server/lib/vscode/out/bootstrap-amd.js
- /opt/code-server/lib/vscode/out/bootstrap-fork.js
	at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
	at Function.Module._load (internal/modules/cjs/loader.js:746:27)
	at Function.n._load (/opt/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:103:27915)
	at Function.E._load (/opt/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:103:24661)
	at Function.c._load (/opt/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:93:59193)
	at Module.require (internal/modules/cjs/loader.js:974:19)
	at require (internal/modules/cjs/helpers.js:92:18)
	at Function.t [as __$__nodeRequire] (/opt/code-server/lib/vscode/out/vs/loader.js:5:101)
	at f._loadCommonJSModule (/opt/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:103:26067)
	at f._doActivateExtension (/opt/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:89:12599)
	at f._activateExtension (/opt/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:89:11658)
	at Object.actualActivateExtension (/opt/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:89:9243)
	at l._activateExtension (/opt/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:84:85443)
	at /opt/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:84:85125
	at Array.map (<anonymous>)
	at l._activateExtensions (/opt/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:84:85113)
	at l.activateByEvent (/opt/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:84:82447)
	at f._activateByEvent (/opt/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:89:10142)
	at /opt/code-server/lib/vscode/out/vs/workbench/services/extensions/node/extensionHostProcess.js:89:20014
	at processTicksAndRejections (internal/process/task_queues.js:95:5)

Screenshot

See above.

Notes

This issue can be reproduced in VS Code: No


@jsjoeio This is the bug report you asked for in issue #3776.

@jsjoeio jsjoeio added the needs-investigation This issue needs to be further investigated label Jul 19, 2021
@jsjoeio jsjoeio added this to the On Deck milestone Jul 19, 2021
@jsjoeio jsjoeio changed the title Once again: Jupyter Notebooks don't work Jupyter Notebooks not working Jul 19, 2021
@jsjoeio
Copy link
Contributor

jsjoeio commented Jul 19, 2021

Planning to look into this after we wrap up 3.11!

@benz0li
Copy link
Contributor Author

benz0li commented Jul 19, 2021

FYI It worked fine with code-server 3.10.2 387b12e, Python 2021.5.926500501 and Jupyter 2021.6.832593372.

@jsjoeio jsjoeio modified the milestones: On Deck, 3.12.0 Jul 19, 2021
@gogobd
Copy link

gogobd commented Jul 31, 2021

I'm not sure if this is related, but in 3.11 I get an error when calling "Jupyter: Create New Blank Notebook":
Screenshot 2021-07-31 at 15 29 23

@jsjoeio
Copy link
Contributor

jsjoeio commented Aug 2, 2021

Thanks for mentioning @gogobd - I got that same error and we're tracking in this issue: #3874

@folshost
Copy link

I can confirm, the same symptom is occurring running 3.12.0. I am running with node v14.18.0 on ppc64le.

@HySoaKa
Copy link

HySoaKa commented Oct 22, 2021

I'm also having troubles with jupyter extension

image

@jsjoeio
Copy link
Contributor

jsjoeio commented Oct 28, 2021

Please see here!

@adalseno
Copy link

adalseno commented Nov 1, 2021

Same issue for me with my installation on my iMac with Os X 10.14 using Homebrew (the latest version of code-server is 3.12.0); jupyter files won't open:

code-server: v3.12.0 VS Code: v1.60.0 Commit: 4cd55f94c0a72f05c18cea070e10b969996614d2 Date: 2021-09-15T19:34:37Z (1 mo ago) Browser: Mozilla/5.0 (X11; CrOS x86_64 14150.64.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.104 Safari/537.36

Python extension installed (v2021.10.1365161279 from open-vsx) and Jupyter too (v2021.8.12; actually I tried to install a more recent version using open-vsx, the installer said that version 2021.10.100 was succesfully installed code-server shows me the other version). They are no python or jupyter duplicated versions in the extension directory.

I can select the python interpreter, also for jupyter server, but when I try to open a .ipynb file I get the following error:

Screenshot 2021-11-02 00 18 05
Screenshot 2021-11-02 00 22 46

The same issue if I run from the iMac where code-server is installed or remotely using my Chromebook.
In local Vscode on my iMac jupyter files open without any issue selecting the same python interpreter.

PS (off-topic) adding the suggested lines in prdouct.json to use open-vsx does not seem to work for me even after a server restart:

"extensionsGallery": { "serviceUrl": "https://open-vsx.org/vscode/gallery", "itemUrl": "https://open-vsx.org/vscode/item" }

@adalseno
Copy link

adalseno commented Nov 3, 2021

Just a little update. I created a Docker container using the command from the FAQ slightly modified (I use port 8081 and a different local config dir since I have code-server running on port 8080:

docker run -d --name code-server -p 8081:8080 \
  -v "$HOME/.config_docker:/home/coder/.config" \
  -v "$PWD/code-projects/:/home/coder/project" \
  -u "$(id -u):$(id -g)" \
  -e "DOCKER_USER=$USER" \
  codercom/code-server:latest

then installed the python extension (that installs also jupyter one), but the issue is still there. Installing miniconda and/or jupyter does not change the situation
Schermata 2021-11-03 alle 12 35 22
.
PS No errors in the docker log and the server is running on https without any issue, simply it won't open jupyter notebooks or create new ones

@jsjoeio
Copy link
Contributor

jsjoeio commented Nov 3, 2021

@adalseno I'm not convinced you're actually installing the extensions from OpenVSX. Can you please follow the docs and try this? Let us know if that works

@adalseno
Copy link

adalseno commented Nov 3, 2021

Hi @jsjoeio , thank you very much for your kind reply.
I did like this:
SERVICE_URL=https://open-vsx.org/vscode/gallery ITEM_URL=https://open-vsx.org/vscode/item code-server --install-extension ms-python.python
Am I doing wrong?
But the error is still there (I cleaned the extension dir before installing).
Schermata 2021-11-03 alle 19 16 04

@jsjoeio
Copy link
Contributor

jsjoeio commented Nov 3, 2021

@adalseno thanks for the quick reply - nope that's exactly right so something is not right!

@adalseno
Copy link

adalseno commented Nov 3, 2021

Hi @jsjoeio ,I don't know if this can help, but, after uninstalling the extensions and cleaning the extension dir, I tried to download the extensions from vsx and manually install them via command line. I got en error installing the latest version of ms-toolsai since it says it is not compatible with Vscode 1.60.0, see the screenshot:
Schermata 2021-11-03 alle 20 13 26
Anyway, even with manual installation the error is still there :(

@jsjoeio
Copy link
Contributor

jsjoeio commented Nov 3, 2021

Yeah, we're in the process of updating VS Code so it should be compatible in the next release 🤞 (sorry for the issues!)

@adalseno
Copy link

adalseno commented Nov 3, 2021

Hi @jsjoeio , will it work if, in the meanwhile, I install a previous version of the plugins? And if so which version? Thanks

@jsjoeio
Copy link
Contributor

jsjoeio commented Nov 3, 2021

@adalseno you might find the answer to that here!

@adalseno
Copy link

adalseno commented Nov 4, 2021

Yes, it worked for 3.9.3 but doing the same on 3.12.0 does not work :
Schermata 2021-11-04 alle 17 46 29
Unfortunately there is no brew formula for version 3.9.3. I hope you will be able to fix 3.12 soon.
Thanks.

@jsjoeio
Copy link
Contributor

jsjoeio commented Nov 4, 2021

Dang it! Thanks for the report.

Unfortunately there is no brew formula for version 3.9.3

Yes, you're right :( I don't think brew keeps old versions around. You can install code-server through npm/yarn and use npm. i.e.

yarn global add code-server@3.9.3

@fritterhoff
Copy link
Contributor

I think we should open this issue again, as also the Python Extension throws a similar error.
grafik

@benz0li
Copy link
Contributor Author

benz0li commented Dec 18, 2021

@jsjoeio Hi, I just tried the latest release artifacts as they also update the vscode version(?)

@fritterhoff The latest release artefacts do not include the fix.
ℹ️ See https://github.com/coder/code-server/blob/main/vendor/package.json#L10 and https://github.com/coder/vscode/commits/main.

@fritterhoff
Copy link
Contributor

fritterhoff commented Dec 18, 2021

Ahhhh fu ... I only checked the timestamps and not the commits. Okay nvm. Than I'll wait until the next dev. build.

@fritterhoff
Copy link
Contributor

@benz0li FYI: I've built my own version - well the extensions work, but some other rather odd effects occure.

Prop. you also will recognize the one or the other (strange) behavior.

@fritterhoff
Copy link
Contributor

fritterhoff commented Dec 19, 2021

So far I figured out at least two issues that are rather strange:

  1. Running NBs does not work: (According to browser console File not found)
J18wyKZCEB.mp4
  1. Changing Python Interpreter does not work. "Failed to set 'pythonPath'. Error: Unable to write to Folder Settings because no resource is provided."
W1ybZ8Js3K-conv.mp4

Okay seems like I figured out in which situation it works and in which not:

If I start code-server using code-server . (notice the dot for the current directory) and visit it using the browser afterwards:

Maybe that helps?

@code-asher
Copy link
Member

code-asher commented Dec 20, 2021 via email

@fritterhoff
Copy link
Contributor

Thank you for testing it and nice find! If it works with ?folder I think I might know where the problem is. I will take a look soon.

Yes, adding the param ?folder= works fine. Afterwards the new version 4.0.0 works great in my case! Great tool for plenty use cases!

@bhatiaabhinav
Copy link

bhatiaabhinav commented Jan 2, 2022

I found this thread after hours of searching on the Internet for the enable-proposed-api problem. And it took another hour to read and understand.

Here is what worked for me finally (@jsjoeio's solution #3782 (comment)) :

  1. Install v4.0.0 prelease code-server.
  2. Install the latest python extension from the sidebar (and the Jupyter extension will get installed automatically). In my case it was Python v2021.12.1559732655 (and Jupyter v2021.11.1001552333).
  3. Add the following snippet to ~/.local/share/code-server/extensions/ms-toolsai.jupyter-<version>/package.json
"enabledApiProposals": [
        "notebookConcatTextDocument",
        "notebookControllerKind",
        "notebookDebugOptions",
        "notebookDeprecated",
        "notebookEditor",
        "notebookEditorDecorationType",
        "notebookEditorEdit",
        "notebookMessaging",
        "notebookMime",
        "notebookCellExecutionState",
        "portsAttributes",
        "textDocumentNotebook",
        "quickPickSortByLabel"
    ],

Restart code-server (without any --enabled-proposed-api arguments)

@jsjoeio
Copy link
Contributor

jsjoeio commented Jan 3, 2022

@bhatiaabhinav sorry you didn't find this sooner (and sorry for the long read)!

Thanks for taking the time to post your quick 3-step solution. Hoping it saves someone else time later!

@benz0li
Copy link
Contributor Author

benz0li commented Jan 5, 2022

@jsjoeio Not working with code-server v4.0.1. Tested with the latest release artefacts.

@code-asher Please check with the deployment at https://vscode-r.jupyter.b-data.ch.
ℹ️ There is code-server v4.0.1 with extensions Python v2021.12.1559732655 and Jupyter v2021.11.1001552333 installed.


Output in web console:

[Error] ReferenceError: Can't find variable: J
	i (notebookWebviewPreloads.js:3)
	Module Code (notebookWebviewPreloads.js:3:24751)
	evaluate
	moduleEvaluation
	(anonymous function)
	promiseReactionJob

@benz0li benz0li mentioned this issue Jan 5, 2022
11 tasks
@fritterhoff
Copy link
Contributor

Output in web console:

[Error] ReferenceError: Can't find variable: J
	i (notebookWebviewPreloads.js:3)
	Module Code (notebookWebviewPreloads.js:3:24751)
	evaluate
	moduleEvaluation
	(anonymous function)
	promiseReactionJob

Jep seeing it finally ...

@fritterhoff
Copy link
Contributor

Yep. Getting the same error.

@fritterhoff
Copy link
Contributor

So I'm playing arround with different versions. Until now I can confirm coder/vscode@0e2dc9d is working, the current artifacts are broken and (try and error) attempt using coder/vscode@acfcdb5 also does not work. Atm I'm building a version using coder/vscode@53bc751 so the issue can be isolated to one or two commits ...

@fritterhoff
Copy link
Contributor

So, it seems like either coder/vscode@53bc751 or coder/vscode@d50b73c causes the issues.

As coder/vscode@53bc751 "only" adds a missing file I'm pretty sure, that coder/vscode@d50b73c (coder/vscode#23) causes the issues. Well now it's up to you @code-asher @jsjoeio to dig into that problems and maybe to revert coder/vscode#23?

@jsjoeio
Copy link
Contributor

jsjoeio commented Jan 5, 2022

@benz0li @fritterhoff wow - thank you both for digging in!

@code-asher should we revert coder/vscode@d50b73c then?

@fritterhoff
Copy link
Contributor

@jsjoeio Atm I'm building a fork of your vscode without that patch and all remaining. So prop. I can tell you in +- 30mins if it works.

@jsjoeio
Copy link
Contributor

jsjoeio commented Jan 5, 2022

@fritterhoff you rock! I'm running it locally with this revert to ensure it works as expected too!

@jsjoeio
Copy link
Contributor

jsjoeio commented Jan 5, 2022

That seemed to do it! Thank you again for making this very easy to fix. We couldn't have done it this fast without both of you

Screen.Recording.2022-01-05.at.10.23.40.AM.mov

@fritterhoff
Copy link
Contributor

Sorry a little bit off topic:
@benz0li may I ask how you manage to install the extensions as built in extensions in your docker containers? I've got a similar use case and did not find a solution until now.

@benz0li
Copy link
Contributor Author

benz0li commented Jan 6, 2022

@benz0li may I ask how you manage to install the extensions as built in extensions in your docker containers? I've got a similar use case and did not find a solution until now.

e.g. code-server --extensions-dir $CODE_BUILTIN_EXTENSIONS_DIR --install-extension ms-toolsai.jupyter with CODE_BUILTIN_EXTENSIONS_DIR=/opt/code-server/vendor/modules/code-oss-dev/extensions;PATH=/opt/code-server/bin:$PATH.

@taeuscherpferd
Copy link

Sorry for posting in a closed thread, but this doesn't appear to be working in the npm install of '4.1.0'. Checking the web browser revealed the same error that you showed above about the ipynbMain.js file missing. I would bet that this is a really simple fix of changing a reference or something for the npm install, but I'm not familiar enough with the codebase to even know where to look. I was able to get around the issue by pulling the compiled version of ipynbMain.js from my install of vscode, and placing it in the location that code-server was looking at. (I also had to create a dist directory for it). Hopefully this gives enough information to help anyone else looking to get around this, as well as helps the maintainer easily resolve this 😄

@code-asher
Copy link
Member

code-asher commented Mar 8, 2022 via email

@code-asher
Copy link
Member

Interesting, I can run yarn pack and the same issue occurs so I can figure out the issue without having to publish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-investigation This issue needs to be further investigated
Projects
None yet