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-qtconsole and jupyter-console could not work for unknown reason

See original GitHub issue

I am using Python 2.7 on CentOS 7, I unintentionally removed some packages using yum autoremove from the system, then I manually reinstalled all these packages, but I found that jupyter can not work properly anymore.Here is how it behaves.

when I run jupyter-qtconsole, the GUI interface pops up, but shows an never-ending message “kernel died, restarting”, also in the backstage command line, it gives the following messages:

Traceback (most recent call last): File “/usr/lib64/python2.7/runpy.py”, line 162, in _run_module_as_main “main”, fname, loader, pkg_name) File “/usr/lib64/python2.7/runpy.py”, line 72, in _run_code exec code in run_globals File “/usr/lib/python2.7/site-packages/ipykernel/main.py”, line 2, in <module> from ipykernel import kernelapp as app File “/usr/lib/python2.7/site-packages/ipykernel/kernelapp.py”, line 98, in <module> ConnectionFileMixin): File “/usr/lib/python2.7/site-packages/IPython/utils/traitlets.py”, line 518, in new return super(MetaHasTraits, mcls).new(mcls, name, bases, classdict) TypeError: Error when calling the metaclass bases metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases

when I run jupyter-notebook, it also does not work properly, the messages is as follows:

Traceback (most recent call last): File “/usr/bin/jupyter-console”, line 11, in <module> sys.exit(main()) File “/usr/lib/python2.7/site-packages/jupyter_core/application.py”, line 267, in launch_instance return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs) File “/usr/lib/python2.7/site-packages/traitlets/config/application.py”, line 595, in launch_instance app.initialize(argv) File “<decorator-gen-119>”, line 2, in initialize File “/usr/lib/python2.7/site-packages/traitlets/config/application.py”, line 74, in catch_config_error return method(app, _args, *_kwargs) File “/usr/lib/python2.7/site-packages/jupyter_console/app.py”, line 138, in initialize self.init_shell() File “/usr/lib/python2.7/site-packages/jupyter_console/app.py”, line 111, in init_shell client=self.kernel_client, File “/usr/lib/python2.7/site-packages/IPython/config/configurable.py”, line 337, in instance inst = cls(_args, *_kwargs) File “/usr/lib/python2.7/site-packages/jupyter_console/interactiveshell.py”, line 135, in init super(ZMQTerminalInteractiveShell, self).init(_args, *_kwargs) File “/usr/lib/python2.7/site-packages/IPython/core/interactiveshell.py”, line 466, in init super(InteractiveShell, self).init(**kwargs) File “/usr/lib/python2.7/site-packages/IPython/config/configurable.py”, line 69, in init self.parent = parent File “/usr/lib/python2.7/site-packages/IPython/utils/traitlets.py”, line 430, in set new_value = self._validate(obj, value) File “/usr/lib/python2.7/site-packages/IPython/utils/traitlets.py”, line 451, in _validate return self.validate(obj, value) File “/usr/lib/python2.7/site-packages/IPython/utils/traitlets.py”, line 965, in validate self.error(obj, value) File “/usr/lib/python2.7/site-packages/IPython/utils/traitlets.py”, line 798, in error raise TraitError(e) IPython.utils.traitlets.TraitError: The ‘parent’ trait of a ZMQTerminalInteractiveShell instance must be a Configurable or None, but a value of class ‘jupyter_console.app.ZMQTerminalIPythonApp’ (i.e. <jupyter_console.app.ZMQTerminalIPythonApp object at 0x7ff2f5ef3c50>) was specified. [~]$ Traceback (most recent call last): File “/usr/lib64/python2.7/runpy.py”, line 162, in _run_module_as_main “main”, fname, loader, pkg_name) File “/usr/lib64/python2.7/runpy.py”, line 72, in _run_code exec code in run_globals File “/usr/lib/python2.7/site-packages/ipykernel/main.py”, line 2, in <module> from ipykernel import kernelapp as app File “/usr/lib/python2.7/site-packages/ipykernel/kernelapp.py”, line 98, in <module> ConnectionFileMixin): File “/usr/lib/python2.7/site-packages/IPython/utils/traitlets.py”, line 518, in new return super(MetaHasTraits, mcls).new(mcls, name, bases, classdict) TypeError: Error when calling the metaclass bases metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases

And also when I run jupyter-notebook, if I try to open an existing notebook or create a new notebook, a message will pop up telling me that “the kernel appear to have died”. In the back stage, the command line is showing the same messages as I type jupyter-qtconsole.

Any ideas how to fix this problem? I am desperate to fix this annoying problem. Thanks a lot~

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jdhaocommented, Jul 12, 2016

In case that anyone might meet the same problem, I will give a list of packages to uninstall and re-install to get the jupyter back to work. The list is ipykernel, ipython, ipython-genutils, ipywidgets, jupyter, jupyter-client, jupyter-console, jupyter-core, nbconvert, nbformat, widgetsnbextension, traitlets

If you are using CentOS 7, please make sure that your system do not have a package named python-ipython-console installed. This is exactly the package that conflicts with the pip-installed ipython-related packages, so uninstall this package before doing the reinstall of python packages.

Also, for some people, the uninstall list might be too long and some of the packages might not need to be uninstalled and re-installed. I try to only remove the package python-ipython-console, then pip uninstall ipython and pip install ipython. After that, jupyter works properly.

1reaction
jdhaocommented, Jun 1, 2016

@takluyver , according to your instructions, I have successfully solve this problem. I found that the system had package named “python-ipython-console”, and I uninstalled this package and other python packages related to jupyter. After reinstall of jupyter, everything is fine again, thanks a lot 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jupyter: magic %qtconsole doesn't work - Stack Overflow
I am trying to use the magic %qtconsole from jupyter notebook. I am working on my local connected to a remote server. WHen...
Read more >
The Qt Console for Jupyter — Jupyter Qt Console 5.4.0 ...
The Qt console can use any Jupyter kernel. ... It's possible that Jupyter's ssh helper functions won't work for you, for various reasons....
Read more >
index.txt
This is not yet configurable. .. tip:: Since the Qt console tries hard to behave ... to all be qt frontends - any...
Read more >
qtconsole - PyPI
Jupyter Qt console. ... A rich Qt-based console for working with Jupyter kernels, supporting rich ... Unfortunately, Qt is not installed when using...
Read more >
Napari & jupyter notebook issue - Image.sc Forum
For some reason I can get napari to work with jupyter notebooks on two machines, but not on a third (the kernel dies)....
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