Bug 1558680

Summary: [abrt] python3-nbconvert: get_kernel_spec(): kernelspec.py:175:get_kernel_spec:jupyter_client.kernelspec.NoSuchKernel: No such kernel named python3
Product: [Fedora] Fedora Reporter: Jan Vesely <jan.vesely>
Component: python-nbconvertAssignee: Mukundan Ragavan <nonamedotc>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 27CC: nonamedotc, quantum.analyst
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/8d98a7ace68939ce039b74b524441380b79e0276
Whiteboard: abrt_hash:1bf76e8173682eb4495f2cad3e648f5863f668e2;VARIANT_ID=workstation;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-05 18:17:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: backtrace
none
File: cgroup
none
File: cpuinfo
none
File: environ
none
File: mountinfo
none
File: namespaces
none
File: open_fds none

Description Jan Vesely 2018-03-20 18:56:18 UTC
Version-Release number of selected component:
python3-nbconvert-5.3.1-3.fc27

Additional info:
reporter:       libreport-2.9.3
cmdline:        /usr/bin/python3 /usr/bin/jupyter-nbconvert --log-level WARN --to notebook --execute --ExecutePreprocessor.timeout=300 --stdout '/home/vesely/PsyNeuLink/tutorial/PsyNeuLink Tutorial.ipynb'
crash_function: get_kernel_spec
exception_type: KeyError
executable:     /usr/bin/jupyter-nbconvert
kernel:         4.15.8-300.fc27.x86_64
runlevel:       N 5
type:           Python3
uid:            1000

Truncated backtrace:
kernelspec.py:175:get_kernel_spec:jupyter_client.kernelspec.NoSuchKernel: No such kernel named python3

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/jupyter_client/kernelspec.py", line 173, in get_kernel_spec
    resource_dir = d[kernel_name.lower()]
KeyError: 'python3'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/jupyter-nbconvert", line 11, in <module>
    load_entry_point('nbconvert==5.3.1', 'console_scripts', 'jupyter-nbconvert')()
  File "/usr/lib/python3.6/site-packages/jupyter_core/application.py", line 267, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/usr/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/usr/lib/python3.6/site-packages/nbconvert/nbconvertapp.py", line 325, in start
    self.convert_notebooks()
  File "/usr/lib/python3.6/site-packages/nbconvert/nbconvertapp.py", line 493, in convert_notebooks
    self.convert_single_notebook(notebook_filename)
  File "/usr/lib/python3.6/site-packages/nbconvert/nbconvertapp.py", line 464, in convert_single_notebook
    output, resources = self.export_single_notebook(notebook_filename, resources, input_buffer=input_buffer)
  File "/usr/lib/python3.6/site-packages/nbconvert/nbconvertapp.py", line 393, in export_single_notebook
    output, resources = self.exporter.from_filename(notebook_filename, resources=resources)
  File "/usr/lib/python3.6/site-packages/nbconvert/exporters/exporter.py", line 174, in from_filename
    return self.from_file(f, resources=resources, **kw)
  File "/usr/lib/python3.6/site-packages/nbconvert/exporters/exporter.py", line 192, in from_file
    return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw)
  File "/usr/lib/python3.6/site-packages/nbconvert/exporters/notebook.py", line 31, in from_notebook_node
    nb_copy, resources = super(NotebookExporter, self).from_notebook_node(nb, resources, **kw)
  File "/usr/lib/python3.6/site-packages/nbconvert/exporters/exporter.py", line 134, in from_notebook_node
    nb_copy, resources = self._preprocess(nb_copy, resources)
  File "/usr/lib/python3.6/site-packages/nbconvert/exporters/exporter.py", line 311, in _preprocess
    nbc, resc = preprocessor(nbc, resc)
  File "/usr/lib/python3.6/site-packages/nbconvert/preprocessors/base.py", line 47, in __call__
    return self.preprocess(nb, resources)
  File "/usr/lib/python3.6/site-packages/nbconvert/preprocessors/execute.py", line 257, in preprocess
    cwd=path)
  File "/usr/lib/python3.6/site-packages/nbconvert/preprocessors/execute.py", line 237, in start_new_kernel
    km.start_kernel(**kwargs)
  File "/usr/lib/python3.6/site-packages/jupyter_client/manager.py", line 230, in start_kernel
    kernel_cmd = self.format_kernel_cmd(extra_arguments=extra_arguments)
  File "/usr/lib/python3.6/site-packages/jupyter_client/manager.py", line 170, in format_kernel_cmd
    cmd = self.kernel_spec.argv + extra_arguments
  File "/usr/lib/python3.6/site-packages/jupyter_client/manager.py", line 82, in kernel_spec
    self._kernel_spec = self.kernel_spec_manager.get_kernel_spec(self.kernel_name)
  File "/usr/lib/python3.6/site-packages/jupyter_client/kernelspec.py", line 175, in get_kernel_spec
    raise NoSuchKernel(kernel_name)
jupyter_client.kernelspec.NoSuchKernel: No such kernel named python3

Local variables in innermost frame:
d: {}
kernel_name: 'python3'
self: <jupyter_client.kernelspec.KernelSpecManager object at 0x7f398057a7b8>

Comment 1 Jan Vesely 2018-03-20 18:56:22 UTC
Created attachment 1410733 [details]
File: backtrace

Comment 2 Jan Vesely 2018-03-20 18:56:23 UTC
Created attachment 1410734 [details]
File: cgroup

Comment 3 Jan Vesely 2018-03-20 18:56:24 UTC
Created attachment 1410735 [details]
File: cpuinfo

Comment 4 Jan Vesely 2018-03-20 18:56:25 UTC
Created attachment 1410736 [details]
File: environ

Comment 5 Jan Vesely 2018-03-20 18:56:26 UTC
Created attachment 1410737 [details]
File: mountinfo

Comment 6 Jan Vesely 2018-03-20 18:56:27 UTC
Created attachment 1410738 [details]
File: namespaces

Comment 7 Jan Vesely 2018-03-20 18:56:28 UTC
Created attachment 1410739 [details]
File: open_fds

Comment 8 Mukundan Ragavan 2018-03-20 22:35:12 UTC
Can you give me some steps to try this out?

I have pushed an update with fixed dependency chain for nbconvert. Can you test the latest build?

Comment 9 Jan Vesely 2018-03-22 06:57:28 UTC
(In reply to Mukundan Ragavan from comment #8)
> Can you give me some steps to try this out?
> 
> I have pushed an update with fixed dependency chain for nbconvert. Can you
> test the latest build?

I think this was a local configuration error.
$ jupyter kernelspec list
returned an empty set

This error went away after installing python kernel;
$ sudo dnf install python3-ipykernel

now:
$ jupyter kernelspec list
Available kernels:
  python3    /usr/share/jupyter/kernels/python3

so it might be just missing dependency somewhere.

thanks,
Jan

Comment 10 Jan Vesely 2018-03-22 07:01:48 UTC
oh, I ran into this running PsyNeuLink[0] test suite:
pytest tests/misc/test_notebooks.py

[0] https://github.com/PrincetonUniversity/PsyNeuLink -b devel

Comment 11 Elliott Sales de Andrade 2018-11-05 11:02:55 UTC
The test suite is using the `--execute` flag to re-run the notebook. This means it needs the kernel that was used to create it installed as well.

No specific kernel is required for nbconvert, so it wasn't installed for you. Installing python3-ipykernel was the correct course of action.

I suggest closing this report, since it's not a bug, really.

Comment 12 Jan Vesely 2018-11-05 18:17:27 UTC
(In reply to Elliott Sales de Andrade from comment #11)
> The test suite is using the `--execute` flag to re-run the notebook. This
> means it needs the kernel that was used to create it installed as well.
> 
> No specific kernel is required for nbconvert, so it wasn't installed for
> you. Installing python3-ipykernel was the correct course of action.
> 
> I suggest closing this report, since it's not a bug, really.

Right. Thanks for the explanation.