ConsoleWidget(): `RuntimeError: You can't initialize an object twice!` with traitlets master
See original GitHub issuefrom qtconsole.qt import QtGui
from qtconsole.console_widget import ConsoleWidget
QtGui.QApplication.instance() or QtGui.QApplication([])
cw = ConsoleWidget()
Results in
Traceback (most recent call last):
File "../../canopy-jupyter/scratch.py", line 4, in <module>
cw = ConsoleWidget()
File "/home/pankaj/work/enthought/jupyter/qtconsole/qtconsole/console_widget.py", line 214, in __init__
LoggingConfigurable.__init__(self, **kw)
File "/home/pankaj/work/enthought/jupyter/traitlets/traitlets/config/configurable.py", line 74, in __init__
super(Configurable, self).__init__(**kwargs)
File "/home/pankaj/work/enthought/jupyter/traitlets/traitlets/traitlets.py", line 946, in __init__
super(HasTraits, self).__init__()
RuntimeError: You can't initialize an object twice!
with traitlets master. This is because of mixing old-style and __init__
call and super
__init__
call.
Simple git bisect
indicated the causal commit to be: https://github.com/ipython/traitlets/pull/174
A solution would be to do things similar to SuperQObject
https://github.com/jupyter/qtconsole/blob/master/qtconsole/util.py#L48 , i.e. a SuperQWidget
, and probably any other Super
qobject subclass which needs to be used in multiple inheritance with HasTraits.
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Issues closed in the 1.0 development cycle
Beginning with version 6.0, IPython stopped supporting compatibility with Python versions lower than 3.3 including all versions of Python 2.7. If you are ......
Read more >IPython Documentation - Read the Docs
IPython has many features for tab-completion, object ... will not allow you to run asynchronous code unless an event loop is specified.
Read more >github-stats-1.0.txt - IPython
View map() on numpy arrays * :ghpull:`4022`: DOC: fix links to matplotlib, notebook docs * :ghpull:`4018`: Fix warning when running IPython.kernel tests ...
Read more >IPython Documentation | Manualzz
If your notebook can't live without the popup functionality, subclass the Box widget (both in Python and JS) and use JQuery UI's draggable()...
Read more >Jupyter-Vim - Coder Social Home
When Vim is using your system python (the default on linux), you can just install ... However, I can't go past below command...
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
Downgrading traitlets to traitlets==4.1.0 solves the issue.
I opened #114, which seems to fix this.