Comments (9)
The multiple-instance error is because of something amiss with the shim. If you import from ipykernel.datapub
it should work.
from ipykernel.
Tried that same error. See below for example.
$ ipython
Python 2.7.10 |Continuum Analytics, Inc.| (default, Oct 19 2015, 18:31:17)
Type "copyright", "credits" or "license" for more information.
IPython 4.0.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: from ipykernel.datapub import publish_data
In [2]: import numpy as np
In [3]: myarr = np.ones(2 * 1024 * 1024 * 1024 * 8 // 64)
In [4]: publish_data({'x': myarr})
---------------------------------------------------------------------------
MultipleInstanceError Traceback (most recent call last)
<ipython-input-4-49f20562eb3f> in <module>()
----> 1 publish_data({'x': myarr})
/zopt/conda/envs/nanshenv/lib/python2.7/site-packages/ipykernel/datapub.pyc in publish_data(data)
55 """
56 from ipykernel.zmqshell import ZMQInteractiveShell
---> 57 ZMQInteractiveShell.instance().data_pub.publish_data(data)
/zopt/conda/envs/nanshenv/lib/python2.7/site-packages/traitlets/config/configurable.pyc in instance(cls, *args, **kwargs)
389 raise MultipleInstanceError(
390 'Multiple incompatible subclass instances of '
--> 391 '%s are being created.' % cls.__name__
392 )
393
MultipleInstanceError: Multiple incompatible subclass instances of ZMQInteractiveShell are being created.
from ipykernel.
Oh, I didn't notice that you were using regular terminal IPython. Terminal IPython doesn't have data publication, so the bug is actually that it should raise an AttributeError or NotImplementedError or some such. Make sure you are using an IPython kernel, such as jupyter console
, notebook, or qtconsole.
from ipykernel.
There's a jupyter console
?! Cool! I did not even know this existed. How does it determine what kernel to use?
from ipykernel.
So, I tried the same exercise with jupyter_console
version 4.0.3
. Here's what happened. Placed in this issue ( jupyter/jupyter_console#33 ).
$ jupyter console
Jupyter Console 4.0.3
[ZMQTerminalIPythonApp] Loading IPython extension: storemagic
[ZMQTerminalIPythonApp] Loading IPython extension: h5py.ipy_completer
In [1]: from ipykernel.datapub import publish_data
In [2]: import numpy as np
In [3]: myarr = np.ones(2 * 1024 * 1024 * 1024 * 8 // 64)
In [4]: publish_data({'x': myarr})
Traceback (most recent call last):
File "/zopt/conda/envs/nanshenv/bin/jupyter-console", line 5, in <module>
app.main()
File "/zopt/conda/envs/nanshenv/lib/python2.7/site-packages/jupyter_core/application.py", line 267, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/zopt/conda/envs/nanshenv/lib/python2.7/site-packages/traitlets/config/application.py", line 592, in launch_instance
app.start()
File "/zopt/conda/envs/nanshenv/lib/python2.7/site-packages/jupyter_console/app.py", line 155, in start
super(ZMQTerminalIPythonApp, self).start()
File "/zopt/conda/envs/nanshenv/lib/python2.7/site-packages/IPython/terminal/ipapp.py", line 353, in start
self.shell.mainloop()
File "/zopt/conda/envs/nanshenv/lib/python2.7/site-packages/jupyter_console/interactiveshell.py", line 420, in mainloop
self.interact(display_banner=display_banner)
File "/zopt/conda/envs/nanshenv/lib/python2.7/site-packages/jupyter_console/interactiveshell.py", line 588, in interact
self.run_cell(source_raw)
File "/zopt/conda/envs/nanshenv/lib/python2.7/site-packages/jupyter_console/interactiveshell.py", line 174, in run_cell
self.handle_iopub(msg_id)
File "/zopt/conda/envs/nanshenv/lib/python2.7/site-packages/jupyter_console/interactiveshell.py", line 262, in handle_iopub
sub_msg = self.client.iopub_channel.get_msg()
File "/zopt/conda/envs/nanshenv/lib/python2.7/site-packages/jupyter_client/blocking/channels.py", line 55, in get_msg
return self._recv()
File "/zopt/conda/envs/nanshenv/lib/python2.7/site-packages/jupyter_client/blocking/channels.py", line 41, in _recv
msg = self.socket.recv_multipart(**kwargs)
File "/zopt/conda/envs/nanshenv/lib/python2.7/site-packages/zmq/sugar/socket.py", line 361, in recv_multipart
part = self.recv(flags, copy=copy, track=track)
File "zmq/backend/cython/socket.pyx", line 676, in zmq.backend.cython.socket.Socket.recv (zmq/backend/cython/socket.c:6507)
File "zmq/backend/cython/socket.pyx", line 710, in zmq.backend.cython.socket.Socket.recv (zmq/backend/cython/socket.c:6307)
File "zmq/backend/cython/socket.pyx", line 147, in zmq.backend.cython.socket._recv_copy (zmq/backend/cython/socket.c:1877)
File "zmq/backend/cython/checkrc.pxd", line 19, in zmq.backend.cython.checkrc._check_rc (zmq/backend/cython/socket.c:6920)
raise Again(errno)
Again: Resource temporarily unavailable
If you suspect this is an IPython bug, please report it at:
https://github.com/ipython/ipython/issues
or send an email to the mailing list at [email protected]
You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.
Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
%config Application.verbose_crash=True
from ipykernel.
Closing because that function is being moved to ipyparallel in any case.
from ipykernel.
So, should this issue be moved somewhere else? AFAICT this is still not fixed.
from ipykernel.
It sounds like the fix is just to make the error message clearer. If there's still anything to do, ipyparallel is the relevant repo:
https://github.com/ipython/ipyparallel
from ipykernel.
Sorry, its been awhile since I look at this. I was wrong. There was a bug. It was a bug in zeromq. @minrk added a workaround for pyzmq. ( zeromq/pyzmq#782 ) So, this is actually fixed.
from ipykernel.
Related Issues (20)
- jupyther
- Should ipykernel align kernel SVG with the one used by JupyterLab?
- CI failing with INTERNALERROR when skipping tests
- Jupyter notebook cell instruction after asyncio.run is not executing with 6.28.0v of ipykernel HOT 4
- Can not install ipykernel HOT 2
- Better cell magic by removing some of the syntax limitations
- python 3.11 debugpy error messages HOT 3
- Directing output of out external threads/processes to specific cells HOT 1
- Qt eventloop interferes with asyncio.call_later in _abort_queues HOT 7
- Incorrect stack traceback when try except finally is used in jupyter notebooks with pandas
- Feature request: enable editing_mode = ‘vi’ for a ZMQTerminalIPythonApp console
- TypeError: '>=' not supported between instances of 'str' and 'datetime.datetime' HOT 3
- Release 7.0 HOT 5
- "ModuleNotFoundError: No module named 'comm'" when running 'python -m ipykernel install'
- Output [ ] Alone HOT 2
- Compatibility with pytest 8 HOT 1
- Different child termination behavior during Kernel shutdown on Posix and Windows systems HOT 1
- Windows: ipykernel install prefix not usable for c:\programdata\jupyter
- AnyIO commit breaks Matplotlib display in separate windows HOT 2
- Restore to previous state with copy-on-write HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ipykernel.