jupyter-qtconsole and jupyter-console could not work for unknown reason
See original GitHub issueI 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:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
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
, thenpip uninstall ipython
andpip install ipython
. After that, jupyter works properly.@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 👍