question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Jupyter: new "kernelspec" tag produces "jupyter_client.kernelspec.NoSuchKernel" with "jupyter nbconvert"

See original GitHub issue

Environment 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

  1. Save mynb.ipynb in VS Code
  2. 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:

  1. 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\")"
   ]
  }
 ]
}
  1. 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:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
rchiodocommented, Apr 8, 2021

Do we need to do this same kernel name argument for our export?

0reactions
DonJayamannecommented, Mar 28, 2022

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found