Cannot run jupyter kernel using python extension #3874
Description
I upgraded to the latest code-server today and now the jupyter interactive functionality of the python extension has stopped working. This happens both when I did this using a remote linux machine (docker based on the pytorch 1.9 image), AND when installing code-server on my local macbook. When opening a jupyter notebook a popup with the following information appears:
Command 'Jupyter: Create New Blank Notebook' resulted in an error (command 'jupyter.createnewnotebook' not found)
OS/Web Information
- Web Browser: brave
- Local OS: macOs
- Remote OS: macos
- Remote Architecture:
code-server --version: 3.11.0 4e8cd09
Steps to Reproduce
On macos (m1):
-
install code-server using install script
-
install python extension (ms-python.python v2021.7.1060902895). This will also install a jupyter extension (ms-toolsai.jupyter v2021.6.832593372)

-
Try to open a new jupyter notebook (cmd+shift+p "Jupyter: Create new Blank Notebook")


The developer console has this error (which is too far in the deep for me to understand):

Expected
A jupyter notebook starts up
Actual
Error message
Command 'Jupyter: Create New Blank Notebook' resulted in an error (command 'jupyter.createnewnotebook' not found)
Activity
jsjoeio commentedon Jul 29, 2021
Thanks for opening the issue! I have never used jupyter notebooks.
Is it possible for you to update the repro steps? What do I need to install or how can I create a new jupyter notebook? Then I can try to reproduce locally and see how we can help you.
Thanks!
simeneide commentedon Jul 30, 2021
Updated, thanks for coming back to me :) I thought "everyone" had this workflow, because it is such a good one ;)
jsjoeio commentedon Jul 30, 2021
Thanks @simeneide for working with me (Python/Jupyter noob here). That was very easy to follow and I received the same error as you.
I can't promise when we will get to this but I will add it to the next cycle and label it as high-priority.
Video
(Apologies in advance if I pronounced your name wrong)
Screen.Recording.2021-07-30.at.10.40.27.AM.mov
balajib-b commentedon Aug 10, 2021
@simeneide the installed jupyter extension facilitates VS Code to interface with jupyter package installed in your env, it doesnt install jupyter notebook to your current environment. I would be happy if you could confirm that the python environment you are using has got jupyter installed.
Open terminal and type "python -m pip list" and check jupyter notebook and its dependent packages are installed. i have been using mixed stack of code server, jupyter, miniconda, pytorch, tensorflow with no issues.
Also requesting you to use latest version of code server.
simeneide commentedon Aug 10, 2021
Yes, all has and I am also able to start jupyter notebook. Currently using 3.11.0 as that is the latest found in brew (which is used when installing with the script). However, it fails much before it starts connecting to the jupyter kernel (as seen in video), so unsure if this is the problem. Are you not able to reproduce my steps? Alternatively, can you provide a step-by-step of how you get your setup to work?
Also: My steps above are working on 3.10, so something has happened.
balajib-b commentedon Aug 11, 2021
@simeneide i doubt whether your jupyter installation is in path. there could be few more possibilities pertaining to this error. ping me at ji.balajib[at]gmail.com lets connect remote and debug. Im happy to help
i think this way its going to be quick and then post back solution here. this could help @jsjoeio close few more issues.
gogobd commentedon Aug 15, 2021
I have the very same problem in 3.11.1 and all previous versions. My last working configuration is code-server-3.9.3-linux-amd64. It would be great if Jupyter Notebooks could be fixed in current versions.
#3776
#3782
#2741
jsjoeio commentedon Aug 16, 2021
Thanks for the notes @gogobd!
It's in the next milestone (3.12) so it will get worked on soon and should come in the next version. We have a couple competing priorities and an off-site this week so I can't promise when but keep an eye out!
simeneide commentedon Aug 16, 2021
Do you know what is missing, @jsjoeio? Otherwise I am pretty sure I can cook up a simple docker image to reproduce this so that you can have a look, @balajib-b.
jsjoeio commentedon Aug 16, 2021
I think I just need to dig into VS Code and figure out where
jupyter.createnewnotebookis defined. I found it here and it's here in code-server. But the name isvscode-notebook-tests🤔 I'd have to look closer at what's happening.I'm not too familiar with how native VS Code commands/extensions get loaded but I'm guessing the issue lies there.
So maybe it's not being included in code-server's latest version for some reason 🤔 @code-asher may have some pro tips for debugging too, but this is where I would start.
(Thanks for asking and offering to help though @simeneide super appreciated♥️ )
23 remaining items
jsjoeio commentedon Sep 22, 2021
Okay we figured it out by adding
bashas a dependency to the homebrew formula and it works locally.We should be running the
postinstallwithsh, but we made it run withbashbecause of Windows 🤔Powershell doesn't have
shorbashby default 🤔 I think we need to revert this line until we can add proper Windows support, specifically revert this PR: #4116Will discuss more tomorrow
Revert "fix: run postinstall script explicitly with bash (#4116)"
Craytor commentedon Sep 24, 2021
So should Jupyter now work after we update?
jsjoeio commentedon Sep 24, 2021
Once 3.12.1 is out, yes!
lg-nineoneninethreenine commentedon Sep 24, 2021
ucalyptus2 commentedon Nov 13, 2021
nopes boy, error persists.
simeneide commentedon Nov 13, 2021
according to @jsjoeio this will be fixed in 3.13 (separate issue). So Im waiting 😁
lg-nineoneninethreenine commentedon Nov 13, 2021
Wait I think it's 4.0.0, asked @jsjoeio two days ago and he said that it's straight to 4.0.0.
lg-nineoneninethreenine commentedon Nov 13, 2021
#4490 (reply in thread)
This was the reply, so there's no 3.12.1 or 3.12.2.
jsjoeio commentedon Nov 15, 2021
Yes! Jupyter kernel should be working in the next release (it was 3.12.1 but it will be 4.0.0) as @im-coder-lg mentioned!
simeneide commentedon Jan 6, 2022
Hi,
UPDATE: I deleted all my old config files and then it worked, so probably something there making some issues. So false alarm :)
I downloaded 4.0.1 now and installed python+jupyter extensions. When starting a jupyter notebook I still get the
Command 'Jupyter: Create New Blank Notebook' resulted in an error (command 'jupyter.createnewnotebook' not found)error. The errors in the developer console looks equivalent to the one reported at the start of this issue.Update: This was done on an ubuntu-machine, not macOS (as brew doesnt install 4.0.1 yet)
jsjoeio commentedon Jan 7, 2022
Hmm @simeneide I just tested this the other day here and it worked as expected. Can you take a look at that comment?
simeneide commentedon Jan 7, 2022
yes sorry @jsjoeio , in my update I note that when I deleted my old config files it ran smoothing. dont know why, but it runs well now :)
jsjoeio commentedon Jan 7, 2022
@simeneide hooray! Well I'm happy it was easy as that :) Thanks for confirming so quickly.