After the latest update of VSCode, I can't run Jupyter notebooks anymore - visual-studio-code

After updating VSCode, I have been unable to run Jupyter notebooks anymore. I am using VSCode on a MacBook Pro Max M1 and am encountering the following error:
Failed to start the Kernel.
Jupyter server crashed. Unable to connect.
Error code from Jupyter: 1
usage: jupyter.py [-h] [--version] [--config-dir] [--data-dir] [--runtime-dir]
[--paths] [--json] [--debug]
[subcommand]
Jupyter: Interactive Computing
positional arguments:
subcommand the subcommand to launch
options:
-h, --help show this help message and exit
--version show the versions of core jupyter packages and exit
--config-dir show Jupyter config dir
--data-dir show Jupyter data dir
--runtime-dir show Jupyter runtime dir
--paths show all Jupyter paths. Add --json for machine-readable
format.
--json output paths as machine-readable json
--debug output debug information about paths
Available subcommands: kernel kernelspec migrate run troubleshoot
Jupyter command jupyter-notebook not found.
View Jupyter log for further details.
Unfortunately, none of the steps I tried have worked.
I am using January 2023 (version 1.75) release and extesion versions are as follows:
Python v2023.2.0
Jupyter v2023.1.2010391206
Has anyone else faced this issue? I would greatly appreciate any suggestions or solutions.
Thank you!
I have tried a number of steps to resolve the issue, including:
Making sure that jupyter-notebook is running in the terminal
Installing Jupyter in new conda and Python virtual environments
Removing VSCode and its related directories completely and downloading it again
Trying the "Switch to Pre-Release Version" for both Jupyter and Python extensions in VSCode
Tried updating jupyter and notebook liberaries
Tried running VSCode with code --no-sandbox

solved downgrading to previous version (November 2022) then updating to latest version again. Running same Python and Jupyter version. Good luck

I ran into this too. I was able to work around it by switching the Jupyter extension to the pre-release version (which was a suggestion in a different question that I can't find anymore).

Related

Jupyter Notebook Error: "Jupyter command `jupyter-notebook` not found."

I just downloaded vscode using homebrew and install python#3.11 using homebrew as well. I used pip3 install jupyter as I saw other recommend to fix this issue and still no luck. I have downloaded all the extensions on vscode and I have set the kernal to homebrew version of python and I still recieve this issue. Note that I have used notebooks in the past and have never gotten this issue so I am not really sure what it is this time. I have not installed anaconda.
I have tried uninstalling and installing the extensions but no luck. I have tried to pip3 uninstall jupyter, pip3 uninstall notebook and reinstall them and still no luck. I have tried to change the kernal to the default python3 on the mac and still nothing. My mac is m1 running on Ventura 13.2. I am able to run python code on regular python files just not using jupyter notebook. I followed the instructions how to set it up on vscode website but I got this error. Any help would be appreciated thank you.
I have same issue using VSCode on Mac OS.
VSCode's 'Jupyter' plugin is broken, causing VSCode unable to bind with python interpreter. Downgrading from v2023.1.2000312134 to v2022.11.1003412109 fixed my issue.
I had the same issue, running on m1 mac (Ventura 13.2). If you aren't already, make sure you are utilising a python virtual environment:
# Create a python virtual environment
$ python -m venv venv
# Activate your python virtual environment
$ source venv/bin/activate
Form your VSCode Command Palette (Shift+Command+P), search and then choose
Jupyter: Select Interpreter to Start Jupyter Server
You should then select the python version that is associated to your virtual environment (venv).

Why has Jupyter notebook kernel stopped working after RStudio package installation

To date I have been using Jupyter Notebook to run R and sometimes Python code. I have also been using RStudio at times. Recently, while using RStudio, I was prompted to install some package (cannot exactly remember). At any rate, I installed this package. Dont know if only coincidence, but trying to run R in the notebook resulted in kernel not connecting. I found the same issue with Python, the Python kernel is also not connecting anymore.
Executing the below, I get;
(base) C:\WINDOWS\system32>jupyter kernelspec list
Available kernels:
ir C:\Users\Admin\AppData\Roaming\jupyter\kernels\ir
python3 C:\Users\Admin\anaconda3\share\jupyter\kernels\python3
How do I get Jupyter Notebook's kernels to work again.
Executing IRkernel::installspec() in R via Anaconda CMD prompt have resolved the issue. Note for others with this issue, you may be prompted to run install.packages(“rlang”) before.

Can't find kernel for vscode jupyter

I am trying to install wolfram kernel for jupyter notebook (vscode) because vscode extension: wolfram language notebook doesn't work.But when I finished installation something werid happended.
I can find wolfram kernel in command line : jupyter kernelspec list, but not in my vscode
Hope someone can tell me how vscode jupyter works?
So I hope my solution (on Linux) will work for you too:
get the repository:
https://github.com/WolframResearch/WolframLanguageForJupyter
add the kernel by executing: wolframscript configure-jupyter.wls add
check if the kernel is added: jupyter kernelspec list
in vscode search for "select Interpreter to start jupyter server" and select your python version
Now the kernels should be updated and you should be able to choose your installed wolfram kernel.
In case its not working I installed the package
python"version"-wolframalpha
. However I do not know if that is necessary.

Cannot find PySpark kernel - aws glue interactive sessions with vscode

I recently follow the instructions to install Glue Interactive sessions with vscode, but I cannot find pyspark kernel (only can see "Glue spark").
I think I have installed everything below (btw I am on Windows)
pip3 install --upgrade jupyter boto3 aws-glue-sessions
pip3 show aws-glue-sessions
cd <site-packages location>\aws_glue_interactive_sessions
jupyter-kernelspec install glue_pyspark
jupyter-kernelspec install glue_spark
But I can run jupyter notebook on terminal to open jupyter notebook working with pyspark without a problem. I guess the issue only happens on working with vscode.
Anyone can give a suggestion what to do?
vscode screenshot:
According to this bug report this issue was fixed a while back VSCode Jupyter Issue 8286
However I'm still experiencing it as are others, as mentioned in the bug report setting the path the full path in the kernel spec file will solve the problem. The kernel spec location depends on where it was installed (user, system or virtual env)
Example using venv: /home/{user}/glue/venv/lib/python3.10/site-packages/aws_glue_interactive_sessions_kernel/glue_pyspark/kernel.json
Update it as follows:
{
"argv": [
"/home/{user}/glue/venv/bin/python",
"-m",
"aws_glue_interactive_sessions_kernel.glue_pyspark.GlueKernel",
"-f",
"{connection_file}"
],
"display_name": "Glue PySpark",
"language": "python"
}
then update the kernel spec: jupyter kernelspec install /home/{user}/glue/venv/lib/python3.10/site-packages/aws_glue_interactive_sessions_kernel/glue_pyspark

JupyterLab application assets not found

I just downloaded jupyter lab using pip on my macbook. When I run jupyter lab on my terminal, browser opens with the following error:
JupyterLab Error JupyterLab application assets not found in
"/opt/homebrew/Cellar/python#3.10/3.10.6_2/Frameworks/Python.framework/Versions/3.10/share/jupyter/lab"
Please run jupyter lab build or use a different app directory
I can run jupyter notebook with no problem.
Note: I can use jupyter lab by running jupyter lab --code-mode
This issue can be resolved by manually set the application directory: jupyter lab --app-dir /opt/homebrew/share/jupyter/lab, replace /opt/homebrew with the actual homebrew path.
Encountered this issue when installing jupyterlab with pip3.
Please run conda install jupyterlab instead. I tried this on with miniforge (https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh) and it worked.