A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/ipython/ipython/issues/1984/ below:

Cannot restart Notebook when using `%%script --bg` · Issue #1984 · ipython/ipython · GitHub

Start BG process like this in notebook:

In [1]:
%%sh --bg
sleep 123456789

Then restart the kernel. You will see error like the following in the notebook log. You can't restart the kernel afterwards unless you explicitly kill the BG process.

[NotebookApp] Kernel restarted: efd05322-f5bd-4bce-83f3-6646c4ed087f
[NotebookApp] Connecting to: tcp://127.0.0.1:45682
[NotebookApp] Connecting to: tcp://127.0.0.1:34921
[NotebookApp] Connecting to: tcp://127.0.0.1:47338
---------------------------------------------------------------------------
ZMQError                                  Traceback (most recent call last)
<string> in <module>()

/home/takafumi/repos/watch/ipython/IPython/zmq/ipkernel.pyc in main()
    914     """Run an IPKernel as an application"""
    915     app = IPKernelApp.instance()
--> 916     app.initialize()
        app.initialize = <bound method IPKernelApp.initialize of <IPython.zmq.ipkernel.IPKernelApp object at 0x399b810>>
    917     app.start()
    918 

/home/takafumi/repos/watch/ipython/IPython/zmq/ipkernel.pyc in initialize(self=<IPython.zmq.ipkernel.IPKernelApp object>, argv=None)

/home/takafumi/repos/watch/ipython/IPython/config/application.pyc in catch_config_error(method=<function initialize>, app=<IPython.zmq.ipkernel.IPKernelApp object>, *args=(None,), **kwargs={})
     82     """
     83     try:
---> 84         return method(app, *args, **kwargs)
        method = <function initialize at 0x399ccf8>
        app = <IPython.zmq.ipkernel.IPKernelApp object at 0x399b810>
        args = (None,)
        kwargs = {}
     85     except (TraitError, ArgumentError) as e:
     86         app.print_description()

/home/takafumi/repos/watch/ipython/IPython/zmq/ipkernel.pyc in initialize(self=<IPython.zmq.ipkernel.IPKernelApp object>, argv=None)
    801     @catch_config_error
    802     def initialize(self, argv=None):
--> 803         super(IPKernelApp, self).initialize(argv)
        global super = undefined
        global IPKernelApp = <class 'IPython.zmq.ipkernel.IPKernelApp'>
        self.initialize = <bound method IPKernelApp.initialize of <IPython.zmq.ipkernel.IPKernelApp object at 0x399b810>>
        argv = None
    804         self.init_path()
    805         self.init_shell()

/home/takafumi/repos/watch/ipython/IPython/zmq/kernelapp.pyc in initialize(self=<IPython.zmq.ipkernel.IPKernelApp object>, argv=None)

/home/takafumi/repos/watch/ipython/IPython/config/application.pyc in catch_config_error(method=<function initialize>, app=<IPython.zmq.ipkernel.IPKernelApp object>, *args=(None,), **kwargs={})
     82     """
     83     try:
---> 84         return method(app, *args, **kwargs)
        method = <function initialize at 0x32035f0>
        app = <IPython.zmq.ipkernel.IPKernelApp object at 0x399b810>
        args = (None,)
        kwargs = {}
     85     except (TraitError, ArgumentError) as e:
     86         app.print_description()

/home/takafumi/repos/watch/ipython/IPython/zmq/kernelapp.pyc in initialize(self=<IPython.zmq.ipkernel.IPKernelApp object>, argv=None)
    310         self.init_session()
    311         self.init_poller()
--> 312         self.init_sockets()
        self.init_sockets = <bound method IPKernelApp.init_sockets of <IPython.zmq.ipkernel.IPKernelApp object at 0x399b810>>
    313         self.init_heartbeat()
    314         # writing/displaying connection info must be *after* init_sockets/heartbeat

/home/takafumi/repos/watch/ipython/IPython/zmq/kernelapp.pyc in init_sockets(self=<IPython.zmq.ipkernel.IPKernelApp object>)
    223 
    224         self.shell_socket = context.socket(zmq.ROUTER)
--> 225         self.shell_port = self._bind_socket(self.shell_socket, self.shell_port)
        self.shell_port = 45682
        self._bind_socket = <bound method IPKernelApp._bind_socket of <IPython.zmq.ipkernel.IPKernelApp object at 0x399b810>>
        self.shell_socket = <zmq.core.socket.Socket object at 0x3991ef0>
    226         self.log.debug("shell ROUTER Channel on port: %i"%self.shell_port)
    227 

/home/takafumi/repos/watch/ipython/IPython/zmq/kernelapp.pyc in _bind_socket(self=<IPython.zmq.ipkernel.IPKernelApp object>, s=<zmq.core.socket.Socket object>, port=45682)
    159             port = s.bind_to_random_port(iface)
    160         else:
--> 161             s.bind(iface + ':%i'%port)
        s.bind = <built-in method bind of zmq.core.socket.Socket object at 0x3991ef0>
        iface = u'tcp://127.0.0.1'
        port = 45682
    162         return port
    163 

/home/takafumi/.local/lib/python2.7/site-packages/zmq/core/socket.so in zmq.core.socket.Socket.bind (zmq/core/socket.c:4797)()

ZMQError: Address already in use

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4