Jupyter: new "kernelspec" tag produces "jupyter_client.kernelspec.NoSuchKernel" with "jupyter nbconvert"
See original GitHub issueEnvironment data
- VS Code version: 1.55.0
- Jupyter Extension version: ms-toolsai.jupyter v2021.5.702919634
- Python Extension version: ms-python.python v2021.3.680753044
- OS and version: MacOSX Catalina 10.15.7
- Python: 3.8.8; Anaconda: 4.3.27
- Type of virtual environment used: conda
- Jupyter server running: Local
Expected behaviour
- Save mynb.ipynb in VS Code
- Convert notebook into html via terminal in the same env using
jupyter nbconvert --to html mynb.ipynb --no-input --execute
Actual behaviour
Conversion produces error
jupyter_client.kernelspec.NoSuchKernel: No such kernel named python388jvsc74a57bd040b90fc7ac2e82be620538bbf156a62f078051c1c11595b3240bdeeddbe7576e
Steps to reproduce:
- mynb.ipynb:
{
"metadata": {
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
},
"orig_nbformat": 2,
"kernelspec": {
"name": "python388jvsc74a57bd040b90fc7ac2e82be620538bbf156a62f078051c1c11595b3240bdeeddbe7576e",
"display_name": "Python 3.8.8 64-bit ('my_env38': conda)"
}
},
"nbformat": 4,
"nbformat_minor": 2,
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"print(\"test\")"
]
}
]
}
jupyter nbconvert --to html mynb.ipynb --no-input --execute
The problem appeared after updating both VS Code and conda, though older notebooks can be converted without any problems in the same env.
The issue can be manually fixed if the “kernelspec” tag is removed:
,
"kernelspec": {
"name": "python388jvsc74a57bd040b90fc7ac2e82be620538bbf156a62f078051c1c11595b3240bdeeddbe7576e",
"display_name": "Python 3.8.8 64-bit ('my_env38': conda)"
}
},
I’m using jupyter nbconvert
because I have not found any ways to hide/remove cells with the built in exporter (the --no-input
flag).
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
jupyter_client.kernelspec.NoSuchKernel: No such kernel ...
When i try to execute below in command line it fails. jupyter nbconvert --to notebook --ExecutePreprocessor.kernel_name=PySpark -- ...
Read more >kernelspec - discovering kernels — jupyter_client 7.4.8 ...
Returns a KernelSpec instance for the given kernel_name. Raises NoSuchKernel if the given kernel name is not found. install_kernel_spec( ...
Read more >jupyter-nbconvert not found | The AI Search Engine You Control
microsoft/vscode-jupyterJupyter: new "kernelspec" tag produces "jupyter_client.kernelspec.NoSuchKernel" with "jupyter nbconvert"#5413.
Read more >Using nbconvert API with a specific kernel in a conda env
to Project Jupyter ... Is there a way to using the nbconvert python API with a kernel installed in ... So with this...
Read more >Parameterized Kernelspecs - HackMD
Kernelspecs are the means by which applications that use Jupyter kernels can ... and nbconvert/papermill (which directly use the jupyter_client APIs), ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Do we need to do this same kernel name argument for our export?
@mihkelvaher I believe this has been resolved, we no longer store the generated name in the ipynb file. Please feel free to re-open this issue if the issue persists or please do create a new one and we’ll look into it.