jupyter / notebook

Jupyter Interactive Notebook
https://jupyter-notebook.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
11.79k stars 5k forks source link

jupyter notebook extremely slow #1927

Open quartermaine opened 8 years ago

quartermaine commented 8 years ago

I try to execute just a small piece of code of python in my jupyter notebook and it's taking forever. I updated Ipython and python but none of them worked.

rgbkrk commented 8 years ago

How slow is it in the standard Python interpreter?

quartermaine commented 8 years ago

It's very slow. It might have something to do with graphlab I use ?

takluyver commented 7 years ago

It's not clear if there's anything for us to do here. Maybe you're just running something that takes a while? There's no obvious reason that the notebook should make execution any slower.

xsway commented 7 years ago

I'm running some (data modelling) code in Jupyter notebook which after execution makes everything painfully slow (e.g. 5-10 secs to execute a cell, 3-4 secs for autocomplete etc). I checked with the standard IPython and there is no such problem there, so I assume it's not the code itself but something on the end of Jupyter?

blink1073 commented 7 years ago

HI @xsway, is your code producing a lot of text or visual output in the Notebook?

xsway commented 7 years ago

No, I removed all logging just in case. I also tried with FIrefox and Chrome, both are slow.

blink1073 commented 7 years ago

Are you logging in to a remote server, or did you launch it from your machine?

xsway commented 7 years ago

My local machine.

blink1073 commented 7 years ago

Using the built in Python kernel?

xsway commented 7 years ago

I think so, but I'm not completely sure. It's the one with this record in .ipython/kernels/python3/kernel.json

"display_name": "IPython (Python 3)", "language": "python", "argv": [ "python3", "-c", "from IPython.kernel.zmq.kernelapp import main; main()", "-f", "{connection_file}" ],

blink1073 commented 7 years ago

Can you share any example code or which libraries you are importing from?

xsway commented 7 years ago

I'm using PyMC3 for Bayesian modelling which I thought initially was the source of the problem, since it's quite slow sometimes and uses some theano computations and variable locking. However, in standard IPython interpreter everything works fine after my code execution. So it shouldn't be my code's problem, right?

blink1073 commented 7 years ago

It could be that the code "finishes" but is still processing in a thread, but presumably you'd see that in the IPython interpreter as well. There is some overhead to sending the data back and forth to the browser, but it shouldn't be as different as what you are seeing if there is not a lot of output showing on the page. I'm afraid I may be out of ideas.

hichana commented 7 years ago

I've noticed that as iPython notebooks become longer Jupyter inevitably gets slower. Is there ever going to be a way around this given Jupyter is running in the browser?

ahsteven commented 7 years ago

Hi I am having a similar issue. I had been able to run this code before without any problem. Now it gets stuck on the second cell. I have pasted the code.

import os

import numpy as np
import cv2
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
# %matplotlib inline
import glob
%matplotlib qt

objpoints = [] #3D points in real world space
imgpoints = [] # 2D points in image plane
nx = 9 # inner x corners
ny = 6 # inner y corners
objp = np.zeros((nx*ny,3),np.float32)
objp[:,:2]= np.mgrid[0:nx,0:ny].T.reshape(-1,2)

# #read in and make a  list of calibration images
images = glob.glob('camera_cal/calibration*.jpg')

# read through all calibration images
for fname in images:
#     img = cv2.imread(fname)
    img = mpimg.imread(fname)
    # Convert to grayscale
#     gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) # if using cv2.imread()
    gray = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY) # if using mpimg.imread()
    # Find the chessboard corners
    ret, corners = cv2.findChessboardCorners(gray, (nx, ny), None)
    if ret == True:
        imgpoints.append(corners)
        objpoints.append(objp)

        cv2.drawChessboardCorners(img, (nx, ny), corners, ret)
        cv2.imshow('img',img)
        cv2.waitKey(500)

cv2.destroyAllWindows()`

`# gray.shape[::-1]returns heidth and width of grayscale
# could also use img.shape[0:2] for color image
img = mpimg.imread(images[1])
imshape = img[:,:,2].shape[::-1]
print(imshape)
ret, mtx, dist, rvecs, tvecs = cv2.calibrateCamera(objpoints, imgpoints, imshape,None,None)
undst = cv2.undistort(img, mtx, dist, None, mtx)

%matplotlib inline
f, (ax1,ax2) = plt.subplots(1,2,figsize=(10,5))

ax1.set_title('Original')
ax1.imshow(img)
ax2.set_title('Udistorted')
ax2.imshow(undst)

Nothing in my code changed. What else could have changed.

josephofiowa commented 7 years ago

My Jupyter Notebook is also extremely slow - I've just updated to Jupyter Notebook 5.0 and run Python 2.7. Even importing Pandas takes ~5 seconds. This is new with Jupyter Notebook 5.0

UPDATE: I have upgraded to Python 3.6. I no longer have this issue.

eranartzi commented 7 years ago

Hey. I've been experiencing a similar issue....also takes a few seconds just to import libs. And when I do some kind of computation it takes for ever.

NMRobert commented 7 years ago

Hi. I am also experiencing this issue since upgrading. However it seems that in my case, performance/responsiveness slowdowns are directly related to the amount of output text rendered to the page. Opening an existing notebook which previously had a ton of text rendered (ie: something like a print() writing hundreds of lines) results in long UI response times, and sluggish evaluation on new cells - even if the text-generating cells have not been re-run.

When I cleared the text-heavy cells, performance returned to normal. Hope this helps!

nealmcb commented 7 years ago

These may all be different sorts of things, but what I'm noticing is a really slow completion issue that I don't remember before.

The Help/About box tells me I have a Jupyter 4.3.1 notebook running IPython 5.1.0 and Python 3.4.3. Others probably need to post their versions as well. I have a bunch of pandas/bokeh imports and code in it. The slowness came back after restarting the python notebook kernel and reloading the jupyter web page.

Most helpful would be some tips on getting relevant metrics on where the slowdown is, e.g. via strace or debugging traces or the like.

takluyver commented 7 years ago

A few people have reported slowdowns in completions with IPython 6.0 (which made some changes to the completion machinery). Can you double check IPython.__version__?

nealmcb commented 7 years ago

OK, I think I know what was causing my completion slowness. My notebook was over 7 MB in size. When I cut out the two cells that constituted most of that (a display of a huge file, and a big bokeh scatter plot), I got down near 1 MB, and completion sped up right away (no notebook reload needed). An easy way to identify unusually large cells might help. In my case, just printing out line lengths and looking for the ones over a megabyte (!), and tracking back to the previous "execution_count" to figure out the reported "In" cell number, helped me track it down.

takluyver commented 7 years ago

Weird, I don't know why that would affect completion.

mhs321 commented 7 years ago

I am experiencing the same issue on my macOS running Sierra.

I am using IPython 5.1.0 and jupyter version 4.2.1

It is taking so long just to import pandas and often crashes. Running the same notebook in Windows is fine.

guillaume-chevalier commented 7 years ago

Slow at the first opening of a notebook and scrolling lags under Chrome for Linux. Killing the ipython3 notebook but to continue to view the notebook makes the scrolling fast again but this does not fix the fact that running the first cell after startup is very slow.

yangmqglobe commented 7 years ago

I am experiencing the same issue, and then I found that if your code has a lots of output, event if it is output at the last time you run it. When you open it or try to run some code, it would be extremely slow, and then I just endure it and click Kernel, wait... Then, click Restart & Clear Output, then everything goes well.

alphagammamle commented 7 years ago

Me too. It takes more than 20 seconds to open the jupyter alone. It is very slow to import pandas and numpy too.

takluyver commented 7 years ago

I think you may be describing a number of different slowdowns under this one issue - the original was a slowdown running code, and other people have described slow completion, slow browser interaction, slow startup, slow imports... These are quite different things.

We know that code which produces a lot of text output can slow the browser down as it makes lots of small additions to the page. In recent versions of the notebook, we've implemented output rate limiting in an attempt to improve on this (so if your code produces loads of output, not all of it is displayed). If you're experiencing this, please upgrade the notebook (pip install --upgrade notebook or conda update notebook).

We know that in some cases calculating completions can be slow. @Carreau is working on improvements to the Jedi inspection library to do better on this front. So if this is what you see, make sure Jedi is up to date (though I think there are more improvements not yet merged/released).

We know that network configuration issues can cause 30-60 second delays in finding the system's public IP address. I don't fully understand this (@minrk knows more), but the code tries to avoid doing it the slow way. If you see this, you can try installing the netifaces module, which the code uses if it's available.

Finally, we know that startup can be slow, especially on spinning hard drives, and especially in 'cold start' - the first time you launch Jupyter after starting your computer, so it's not cached in memory. This is a consequence of opening many separate files (Python modules). This also seems to be worse on Windows. There may be ways we can improve on this, but they're not easy ways, and slow and working is better than fast and broken. Many people will start Jupyter once and then use it for hours, so fast startup is a lower priority than it is for terminal IPython, which we more often start and quit repeatedly.

If you're seeing a kind of slowdown which you don't think falls into one of those categories, please open a new issue with a detailed description: what platform are you on, what are you trying to do, what version of the notebook do you have (jupyter notebook --version), how are you launching it...

minrk commented 7 years ago

Especially if it's consistently slightly above 20 or 30 seconds, the issue we've seen is a DNS lookup due to misconfigured DNS settings, primarily on Linux. The call that takes time in this case is:

import socket
socket.gethostbyname_ex(socket.gethostname())

If that completes quickly, it's something else.

prasanth-ntu commented 6 years ago

I have been using jupyter notebook for the past few months and it's a fantastic piece of work. It really made my life easier as a PhD student by allowing me to write the code & markdown at same place including ability to add in images, formulas, table of contents and other text based formattings along with numerous extensions.

Wondering whether there're do's & dont's for someone using Jupyter notebook intensively

At times, I face the issue mentioned by the user in earliler post. Especially when the jupyter notebook gets bigger (still within an MB), it starts slowing down and it's very obvious. A simple click from one cell to another or tab completion or selection of a text starts to take few seconds which really hinders the productivity.

demorphica commented 6 years ago

Here's what i found slows down my notebook the most -

  1. slowness is directly proportional to # of cells in the notebook - does not matter if they are code cells or markdown, merging cells reduces slowness (but export your cells as .py files & import them if your merged cells get too big)

  2. typesetting addons - i see more latex & math formatting messages preventing my notebook becoming accessible if the # of cells grows

  3. Jupyterlab is faster than Jupyter for the same notebook

  4. Starting from a notebook with cleared outputs is faster than starting from an notebook with outputs already inline in the notebook

  5. big cells - now i move my big functions to .py files in the same dir & import them

  6. Restarting the kernel to re run causes a reload but execution is faster than re run all cells without restarting

  7. Use of the nbextensions reduce cell width extension . notebooks where this has not been used for any cells are faster than notebooks with cells that line up as columns

image

  1. errors in your notebook. The error occured on the 2nd last cpu spike, but the notebook was unresponsive until after the last spike - it is not responsive enough to even scroll to the error until the last spike

This is what is see in logs sometimes. When this happens i have to reboot my conda environment & restart my browser to get working again

Perhaps this helps troubleshoot

poll 1801.163 ms took 1803.047 ms: timeout
poll 2997.560 ms took 3001.112 ms: timeout
[I 21:35:27.391 LabApp] Starting buffering for 82cfd0e9-e7a9-4918-a492-43cda93b541a:9d200c2f77bf4f70b01ff5e88efdc975
Future exception was never retrieved
future: <Future finished exception=WebSocketClosedError() created at /opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py:811>
source_traceback: Object created at (most recent call last):
  File "/opt/conda/envs/jupyter/bin/jupyter-lab", line 11, in <module>
    sys.exit(main())
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/notebookapp.py", line 1670, in start
    self.io_loop.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 127, in start
    self.asyncio_loop.run_forever()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 422, in run_forever
    self._run_once()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 1424, in _run_once
    handle._run()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/events.py", line 145, in _run
    self._callback(*self._args)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 117, in _handle_events
    handler_func(fileobj, events)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 276, in null_wrapper
    return fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 450, in _handle_events
    self._handle_recv()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 480, in _handle_recv
    self._run_callback(callback, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 432, in _run_callback
    callback(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 315, in wrapped
    ret = fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 196, in <lambda>
    self.on_recv(lambda msg: callback(self, msg), copy=copy)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/services/kernels/handlers.py", line 418, in _on_zmq_reply
    super(ZMQChannelsHandler, self)._on_zmq_reply(stream, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/base/zmqhandlers.py", line 250, in _on_zmq_reply
    self.write_message(msg, binary=isinstance(msg, bytes))
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 256, in write_message
    return self.ws_connection.write_message(message, binary=binary)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 811, in write_message
    return wrapper()
Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 808, in wrapper
    yield fut
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run
    value = future.result()
tornado.iostream.StreamClosedError: Stream is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1107, in run
    yielded = self.gen.throw(*exc_info)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 810, in wrapper
    raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError
Future exception was never retrieved
future: <Future finished exception=WebSocketClosedError() created at /opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py:811>
source_traceback: Object created at (most recent call last):
  File "/opt/conda/envs/jupyter/bin/jupyter-lab", line 11, in <module>
    sys.exit(main())
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/notebookapp.py", line 1670, in start
    self.io_loop.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 127, in start
    self.asyncio_loop.run_forever()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 422, in run_forever
    self._run_once()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 1424, in _run_once
    handle._run()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/events.py", line 145, in _run
    self._callback(*self._args)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/ioloop.py", line 759, in _run_callback
    ret = callback()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 276, in null_wrapper
    return fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 536, in <lambda>
    self.io_loop.add_callback(lambda : self._handle_events(self.socket, 0))
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 450, in _handle_events
    self._handle_recv()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 480, in _handle_recv
    self._run_callback(callback, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 432, in _run_callback
    callback(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 315, in wrapped
    ret = fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 196, in <lambda>
    self.on_recv(lambda msg: callback(self, msg), copy=copy)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/services/kernels/handlers.py", line 418, in _on_zmq_reply
    super(ZMQChannelsHandler, self)._on_zmq_reply(stream, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/base/zmqhandlers.py", line 250, in _on_zmq_reply
    self.write_message(msg, binary=isinstance(msg, bytes))
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 256, in write_message
    return self.ws_connection.write_message(message, binary=binary)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 811, in write_message
    return wrapper()
Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 808, in wrapper
    yield fut
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run
    value = future.result()
tornado.iostream.StreamClosedError: Stream is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1107, in run
    yielded = self.gen.throw(*exc_info)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 810, in wrapper
    raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError
Future exception was never retrieved
future: <Future finished exception=WebSocketClosedError() created at /opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py:811>
source_traceback: Object created at (most recent call last):
  File "/opt/conda/envs/jupyter/bin/jupyter-lab", line 11, in <module>
    sys.exit(main())
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/notebookapp.py", line 1670, in start
    self.io_loop.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 127, in start
    self.asyncio_loop.run_forever()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 422, in run_forever
    self._run_once()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 1424, in _run_once
    handle._run()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/events.py", line 145, in _run
    self._callback(*self._args)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 117, in _handle_events
    handler_func(fileobj, events)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 276, in null_wrapper
    return fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 450, in _handle_events
    self._handle_recv()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 480, in _handle_recv
    self._run_callback(callback, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 432, in _run_callback
    callback(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 315, in wrapped
    ret = fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 196, in <lambda>
    self.on_recv(lambda msg: callback(self, msg), copy=copy)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/services/kernels/handlers.py", line 418, in _on_zmq_reply
    super(ZMQChannelsHandler, self)._on_zmq_reply(stream, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/base/zmqhandlers.py", line 250, in _on_zmq_reply
    self.write_message(msg, binary=isinstance(msg, bytes))
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 256, in write_message
    return self.ws_connection.write_message(message, binary=binary)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 811, in write_message
    return wrapper()
Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 808, in wrapper
    yield fut
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run
    value = future.result()
tornado.iostream.StreamClosedError: Stream is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1107, in run
    yielded = self.gen.throw(*exc_info)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 810, in wrapper
    raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError
Future exception was never retrieved
future: <Future finished exception=WebSocketClosedError() created at /opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py:811>
source_traceback: Object created at (most recent call last):
  File "/opt/conda/envs/jupyter/bin/jupyter-lab", line 11, in <module>
    sys.exit(main())
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/notebookapp.py", line 1670, in start
    self.io_loop.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 127, in start
    self.asyncio_loop.run_forever()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 422, in run_forever
    self._run_once()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 1424, in _run_once
    handle._run()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/events.py", line 145, in _run
    self._callback(*self._args)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/ioloop.py", line 759, in _run_callback
    ret = callback()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 276, in null_wrapper
    return fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 536, in <lambda>
    self.io_loop.add_callback(lambda : self._handle_events(self.socket, 0))
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 450, in _handle_events
    self._handle_recv()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 480, in _handle_recv
    self._run_callback(callback, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 432, in _run_callback
    callback(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 315, in wrapped
    ret = fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 196, in <lambda>
    self.on_recv(lambda msg: callback(self, msg), copy=copy)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/services/kernels/handlers.py", line 418, in _on_zmq_reply
    super(ZMQChannelsHandler, self)._on_zmq_reply(stream, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/base/zmqhandlers.py", line 250, in _on_zmq_reply
    self.write_message(msg, binary=isinstance(msg, bytes))
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 256, in write_message
    return self.ws_connection.write_message(message, binary=binary)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 811, in write_message
    return wrapper()
Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 808, in wrapper
    yield fut
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run
    value = future.result()
tornado.iostream.StreamClosedError: Stream is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1107, in run
    yielded = self.gen.throw(*exc_info)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 810, in wrapper
    raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError
Future exception was never retrieved
future: <Future finished exception=WebSocketClosedError() created at /opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py:811>
source_traceback: Object created at (most recent call last):
  File "/opt/conda/envs/jupyter/bin/jupyter-lab", line 11, in <module>
    sys.exit(main())
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/notebookapp.py", line 1670, in start
    self.io_loop.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 127, in start
    self.asyncio_loop.run_forever()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 422, in run_forever
    self._run_once()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 1424, in _run_once
    handle._run()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/events.py", line 145, in _run
    self._callback(*self._args)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/ioloop.py", line 759, in _run_callback
    ret = callback()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 276, in null_wrapper
    return fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 536, in <lambda>
    self.io_loop.add_callback(lambda : self._handle_events(self.socket, 0))
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 450, in _handle_events
    self._handle_recv()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 480, in _handle_recv
    self._run_callback(callback, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 432, in _run_callback
    callback(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 315, in wrapped
    ret = fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 196, in <lambda>
    self.on_recv(lambda msg: callback(self, msg), copy=copy)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/services/kernels/handlers.py", line 418, in _on_zmq_reply
    super(ZMQChannelsHandler, self)._on_zmq_reply(stream, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/base/zmqhandlers.py", line 250, in _on_zmq_reply
    self.write_message(msg, binary=isinstance(msg, bytes))
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 256, in write_message
    return self.ws_connection.write_message(message, binary=binary)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 811, in write_message
    return wrapper()
Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 808, in wrapper
    yield fut
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run
    value = future.result()
tornado.iostream.StreamClosedError: Stream is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1107, in run
    yielded = self.gen.throw(*exc_info)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 810, in wrapper
    raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError
Future exception was never retrieved
future: <Future finished exception=WebSocketClosedError() created at /opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py:811>
source_traceback: Object created at (most recent call last):
  File "/opt/conda/envs/jupyter/bin/jupyter-lab", line 11, in <module>
    sys.exit(main())
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/notebookapp.py", line 1670, in start
    self.io_loop.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 127, in start
    self.asyncio_loop.run_forever()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 422, in run_forever
    self._run_once()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 1424, in _run_once
    handle._run()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/events.py", line 145, in _run
    self._callback(*self._args)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/ioloop.py", line 759, in _run_callback
    ret = callback()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 276, in null_wrapper
    return fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 536, in <lambda>
    self.io_loop.add_callback(lambda : self._handle_events(self.socket, 0))
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 450, in _handle_events
    self._handle_recv()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 480, in _handle_recv
    self._run_callback(callback, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 432, in _run_callback
    callback(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 315, in wrapped
    ret = fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 196, in <lambda>
    self.on_recv(lambda msg: callback(self, msg), copy=copy)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/services/kernels/handlers.py", line 418, in _on_zmq_reply
    super(ZMQChannelsHandler, self)._on_zmq_reply(stream, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/base/zmqhandlers.py", line 250, in _on_zmq_reply
    self.write_message(msg, binary=isinstance(msg, bytes))
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 256, in write_message
    return self.ws_connection.write_message(message, binary=binary)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 811, in write_message
    return wrapper()
Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 808, in wrapper
    yield fut
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run
    value = future.result()
tornado.iostream.StreamClosedError: Stream is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1107, in run
    yielded = self.gen.throw(*exc_info)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 810, in wrapper
    raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError
Future exception was never retrieved
future: <Future finished exception=WebSocketClosedError() created at /opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py:811>
source_traceback: Object created at (most recent call last):
  File "/opt/conda/envs/jupyter/bin/jupyter-lab", line 11, in <module>
    sys.exit(main())
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/notebookapp.py", line 1670, in start
    self.io_loop.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 127, in start
    self.asyncio_loop.run_forever()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 422, in run_forever
    self._run_once()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 1424, in _run_once
    handle._run()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/events.py", line 145, in _run
    self._callback(*self._args)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 117, in _handle_events
    handler_func(fileobj, events)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 276, in null_wrapper
    return fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 450, in _handle_events
    self._handle_recv()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 480, in _handle_recv
    self._run_callback(callback, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 432, in _run_callback
    callback(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 315, in wrapped
    ret = fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 196, in <lambda>
    self.on_recv(lambda msg: callback(self, msg), copy=copy)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/services/kernels/handlers.py", line 418, in _on_zmq_reply
    super(ZMQChannelsHandler, self)._on_zmq_reply(stream, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/base/zmqhandlers.py", line 250, in _on_zmq_reply
    self.write_message(msg, binary=isinstance(msg, bytes))
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 256, in write_message
    return self.ws_connection.write_message(message, binary=binary)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 811, in write_message
    return wrapper()
Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 808, in wrapper
    yield fut
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run
    value = future.result()
tornado.iostream.StreamClosedError: Stream is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1107, in run
    yielded = self.gen.throw(*exc_info)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 810, in wrapper
    raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError
Future exception was never retrieved
future: <Future finished exception=WebSocketClosedError() created at /opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py:811>
source_traceback: Object created at (most recent call last):
  File "/opt/conda/envs/jupyter/bin/jupyter-lab", line 11, in <module>
    sys.exit(main())
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/notebookapp.py", line 1670, in start
    self.io_loop.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 127, in start
    self.asyncio_loop.run_forever()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 422, in run_forever
    self._run_once()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 1424, in _run_once
    handle._run()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/events.py", line 145, in _run
    self._callback(*self._args)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 117, in _handle_events
    handler_func(fileobj, events)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 276, in null_wrapper
    return fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 450, in _handle_events
    self._handle_recv()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 480, in _handle_recv
    self._run_callback(callback, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 432, in _run_callback
    callback(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 315, in wrapped
    ret = fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 196, in <lambda>
    self.on_recv(lambda msg: callback(self, msg), copy=copy)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/services/kernels/handlers.py", line 418, in _on_zmq_reply
    super(ZMQChannelsHandler, self)._on_zmq_reply(stream, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/base/zmqhandlers.py", line 250, in _on_zmq_reply
    self.write_message(msg, binary=isinstance(msg, bytes))
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 256, in write_message
    return self.ws_connection.write_message(message, binary=binary)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 811, in write_message
    return wrapper()
Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 808, in wrapper
    yield fut
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run
    value = future.result()
tornado.iostream.StreamClosedError: Stream is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1107, in run
    yielded = self.gen.throw(*exc_info)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 810, in wrapper
    raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError
Future exception was never retrieved
future: <Future finished exception=WebSocketClosedError() created at /opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py:811>
source_traceback: Object created at (most recent call last):
  File "/opt/conda/envs/jupyter/bin/jupyter-lab", line 11, in <module>
    sys.exit(main())
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/notebookapp.py", line 1670, in start
    self.io_loop.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 127, in start
    self.asyncio_loop.run_forever()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 422, in run_forever
    self._run_once()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 1424, in _run_once
    handle._run()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/events.py", line 145, in _run
    self._callback(*self._args)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 117, in _handle_events
    handler_func(fileobj, events)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 276, in null_wrapper
    return fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 450, in _handle_events
    self._handle_recv()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 480, in _handle_recv
    self._run_callback(callback, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 432, in _run_callback
    callback(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 315, in wrapped
    ret = fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 196, in <lambda>
    self.on_recv(lambda msg: callback(self, msg), copy=copy)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/services/kernels/handlers.py", line 418, in _on_zmq_reply
    super(ZMQChannelsHandler, self)._on_zmq_reply(stream, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/base/zmqhandlers.py", line 250, in _on_zmq_reply
    self.write_message(msg, binary=isinstance(msg, bytes))
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 256, in write_message
    return self.ws_connection.write_message(message, binary=binary)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 811, in write_message
    return wrapper()
Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 808, in wrapper
    yield fut
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run
    value = future.result()
tornado.iostream.StreamClosedError: Stream is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1107, in run
    yielded = self.gen.throw(*exc_info)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 810, in wrapper
    raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError
Future exception was never retrieved
future: <Future finished exception=WebSocketClosedError() created at /opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py:811>
source_traceback: Object created at (most recent call last):
  File "/opt/conda/envs/jupyter/bin/jupyter-lab", line 11, in <module>
    sys.exit(main())
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/notebookapp.py", line 1670, in start
    self.io_loop.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 127, in start
    self.asyncio_loop.run_forever()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 422, in run_forever
    self._run_once()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 1424, in _run_once
    handle._run()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/events.py", line 145, in _run
    self._callback(*self._args)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/ioloop.py", line 759, in _run_callback
    ret = callback()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 276, in null_wrapper
    return fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 536, in <lambda>
    self.io_loop.add_callback(lambda : self._handle_events(self.socket, 0))
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 450, in _handle_events
    self._handle_recv()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 480, in _handle_recv
    self._run_callback(callback, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 432, in _run_callback
    callback(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 315, in wrapped
    ret = fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 196, in <lambda>
    self.on_recv(lambda msg: callback(self, msg), copy=copy)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/services/kernels/handlers.py", line 418, in _on_zmq_reply
    super(ZMQChannelsHandler, self)._on_zmq_reply(stream, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/base/zmqhandlers.py", line 250, in _on_zmq_reply
    self.write_message(msg, binary=isinstance(msg, bytes))
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 256, in write_message
    return self.ws_connection.write_message(message, binary=binary)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 811, in write_message
    return wrapper()
Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 808, in wrapper
    yield fut
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run
    value = future.result()
tornado.iostream.StreamClosedError: Stream is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1107, in run
    yielded = self.gen.throw(*exc_info)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 810, in wrapper
    raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError
Future exception was never retrieved
future: <Future finished exception=WebSocketClosedError() created at /opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py:811>
source_traceback: Object created at (most recent call last):
  File "/opt/conda/envs/jupyter/bin/jupyter-lab", line 11, in <module>
    sys.exit(main())
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/notebookapp.py", line 1670, in start
    self.io_loop.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 127, in start
    self.asyncio_loop.run_forever()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 422, in run_forever
    self._run_once()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 1424, in _run_once
    handle._run()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/events.py", line 145, in _run
    self._callback(*self._args)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/ioloop.py", line 759, in _run_callback
    ret = callback()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 276, in null_wrapper
    return fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 536, in <lambda>
    self.io_loop.add_callback(lambda : self._handle_events(self.socket, 0))
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 450, in _handle_events
    self._handle_recv()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 480, in _handle_recv
    self._run_callback(callback, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 432, in _run_callback
    callback(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 315, in wrapped
    ret = fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 196, in <lambda>
    self.on_recv(lambda msg: callback(self, msg), copy=copy)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/services/kernels/handlers.py", line 418, in _on_zmq_reply
    super(ZMQChannelsHandler, self)._on_zmq_reply(stream, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/base/zmqhandlers.py", line 250, in _on_zmq_reply
    self.write_message(msg, binary=isinstance(msg, bytes))
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 256, in write_message
    return self.ws_connection.write_message(message, binary=binary)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 811, in write_message
    return wrapper()
Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 808, in wrapper
    yield fut
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run
    value = future.result()
tornado.iostream.StreamClosedError: Stream is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1107, in run
    yielded = self.gen.throw(*exc_info)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 810, in wrapper
    raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError
Future exception was never retrieved
future: <Future finished exception=WebSocketClosedError() created at /opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py:811>
source_traceback: Object created at (most recent call last):
  File "/opt/conda/envs/jupyter/bin/jupyter-lab", line 11, in <module>
    sys.exit(main())
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/notebookapp.py", line 1670, in start
    self.io_loop.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 127, in start
    self.asyncio_loop.run_forever()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 422, in run_forever
    self._run_once()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 1424, in _run_once
    handle._run()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/events.py", line 145, in _run
    self._callback(*self._args)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/ioloop.py", line 759, in _run_callback
    ret = callback()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 276, in null_wrapper
    return fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 536, in <lambda>
    self.io_loop.add_callback(lambda : self._handle_events(self.socket, 0))
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 450, in _handle_events
    self._handle_recv()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 480, in _handle_recv
    self._run_callback(callback, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 432, in _run_callback
    callback(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 315, in wrapped
    ret = fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 196, in <lambda>
    self.on_recv(lambda msg: callback(self, msg), copy=copy)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/services/kernels/handlers.py", line 418, in _on_zmq_reply
    super(ZMQChannelsHandler, self)._on_zmq_reply(stream, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/base/zmqhandlers.py", line 250, in _on_zmq_reply
    self.write_message(msg, binary=isinstance(msg, bytes))
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 256, in write_message
    return self.ws_connection.write_message(message, binary=binary)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 811, in write_message
    return wrapper()
Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 808, in wrapper
    yield fut
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run
    value = future.result()
tornado.iostream.StreamClosedError: Stream is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1107, in run
    yielded = self.gen.throw(*exc_info)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 810, in wrapper
    raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError
Future exception was never retrieved
future: <Future finished exception=WebSocketClosedError() created at /opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py:811>
source_traceback: Object created at (most recent call last):
  File "/opt/conda/envs/jupyter/bin/jupyter-lab", line 11, in <module>
    sys.exit(main())
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/notebookapp.py", line 1670, in start
    self.io_loop.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 127, in start
    self.asyncio_loop.run_forever()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 422, in run_forever
    self._run_once()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 1424, in _run_once
    handle._run()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/events.py", line 145, in _run
    self._callback(*self._args)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 117, in _handle_events
    handler_func(fileobj, events)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 276, in null_wrapper
    return fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 450, in _handle_events
    self._handle_recv()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 480, in _handle_recv
    self._run_callback(callback, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 432, in _run_callback
    callback(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 315, in wrapped
    ret = fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 196, in <lambda>
    self.on_recv(lambda msg: callback(self, msg), copy=copy)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/services/kernels/handlers.py", line 418, in _on_zmq_reply
    super(ZMQChannelsHandler, self)._on_zmq_reply(stream, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/base/zmqhandlers.py", line 250, in _on_zmq_reply
    self.write_message(msg, binary=isinstance(msg, bytes))
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 256, in write_message
    return self.ws_connection.write_message(message, binary=binary)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 811, in write_message
    return wrapper()
Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 808, in wrapper
    yield fut
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run
    value = future.result()
tornado.iostream.StreamClosedError: Stream is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1107, in run
    yielded = self.gen.throw(*exc_info)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 810, in wrapper
    raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError
Future exception was never retrieved
future: <Future finished exception=WebSocketClosedError() created at /opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py:811>
source_traceback: Object created at (most recent call last):
  File "/opt/conda/envs/jupyter/bin/jupyter-lab", line 11, in <module>
    sys.exit(main())
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/notebookapp.py", line 1670, in start
    self.io_loop.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 127, in start
    self.asyncio_loop.run_forever()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 422, in run_forever
    self._run_once()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 1424, in _run_once
    handle._run()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/events.py", line 145, in _run
    self._callback(*self._args)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 117, in _handle_events
    handler_func(fileobj, events)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 276, in null_wrapper
    return fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 450, in _handle_events
    self._handle_recv()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 480, in _handle_recv
    self._run_callback(callback, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 432, in _run_callback
    callback(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 315, in wrapped
    ret = fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 196, in <lambda>
    self.on_recv(lambda msg: callback(self, msg), copy=copy)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/services/kernels/handlers.py", line 418, in _on_zmq_reply
    super(ZMQChannelsHandler, self)._on_zmq_reply(stream, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/base/zmqhandlers.py", line 250, in _on_zmq_reply
    self.write_message(msg, binary=isinstance(msg, bytes))
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 256, in write_message
    return self.ws_connection.write_message(message, binary=binary)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 811, in write_message
    return wrapper()
Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 808, in wrapper
    yield fut
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run
    value = future.result()
tornado.iostream.StreamClosedError: Stream is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1107, in run
    yielded = self.gen.throw(*exc_info)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 810, in wrapper
    raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError
Future exception was never retrieved
future: <Future finished exception=WebSocketClosedError() created at /opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py:811>
source_traceback: Object created at (most recent call last):
  File "/opt/conda/envs/jupyter/bin/jupyter-lab", line 11, in <module>
    sys.exit(main())
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/notebookapp.py", line 1670, in start
    self.io_loop.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 127, in start
    self.asyncio_loop.run_forever()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 422, in run_forever
    self._run_once()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 1424, in _run_once
    handle._run()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/events.py", line 145, in _run
    self._callback(*self._args)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/ioloop.py", line 759, in _run_callback
    ret = callback()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 276, in null_wrapper
    return fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 536, in <lambda>
    self.io_loop.add_callback(lambda : self._handle_events(self.socket, 0))
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 450, in _handle_events
    self._handle_recv()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 480, in _handle_recv
    self._run_callback(callback, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 432, in _run_callback
    callback(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 315, in wrapped
    ret = fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 196, in <lambda>
    self.on_recv(lambda msg: callback(self, msg), copy=copy)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/services/kernels/handlers.py", line 418, in _on_zmq_reply
    super(ZMQChannelsHandler, self)._on_zmq_reply(stream, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/base/zmqhandlers.py", line 250, in _on_zmq_reply
    self.write_message(msg, binary=isinstance(msg, bytes))
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 256, in write_message
    return self.ws_connection.write_message(message, binary=binary)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 811, in write_message
    return wrapper()
Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 808, in wrapper
    yield fut
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run
    value = future.result()
tornado.iostream.StreamClosedError: Stream is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1107, in run
    yielded = self.gen.throw(*exc_info)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 810, in wrapper
    raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError
Future exception was never retrieved
future: <Future finished exception=WebSocketClosedError() created at /opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py:811>
source_traceback: Object created at (most recent call last):
  File "/opt/conda/envs/jupyter/bin/jupyter-lab", line 11, in <module>
    sys.exit(main())
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/notebookapp.py", line 1670, in start
    self.io_loop.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 127, in start
    self.asyncio_loop.run_forever()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 422, in run_forever
    self._run_once()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 1424, in _run_once
    handle._run()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/events.py", line 145, in _run
    self._callback(*self._args)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 117, in _handle_events
    handler_func(fileobj, events)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 276, in null_wrapper
    return fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 450, in _handle_events
    self._handle_recv()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 480, in _handle_recv
    self._run_callback(callback, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 432, in _run_callback
    callback(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 315, in wrapped
    ret = fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 196, in <lambda>
    self.on_recv(lambda msg: callback(self, msg), copy=copy)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/services/kernels/handlers.py", line 418, in _on_zmq_reply
    super(ZMQChannelsHandler, self)._on_zmq_reply(stream, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/base/zmqhandlers.py", line 250, in _on_zmq_reply
    self.write_message(msg, binary=isinstance(msg, bytes))
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 256, in write_message
    return self.ws_connection.write_message(message, binary=binary)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 811, in write_message
    return wrapper()
Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 808, in wrapper
    yield fut
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run
    value = future.result()
tornado.iostream.StreamClosedError: Stream is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1107, in run
    yielded = self.gen.throw(*exc_info)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 810, in wrapper
    raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError
Future exception was never retrieved
future: <Future finished exception=WebSocketClosedError() created at /opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py:811>
source_traceback: Object created at (most recent call last):
  File "/opt/conda/envs/jupyter/bin/jupyter-lab", line 11, in <module>
    sys.exit(main())
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance
    app.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/notebookapp.py", line 1670, in start
    self.io_loop.start()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 127, in start
    self.asyncio_loop.run_forever()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 422, in run_forever
    self._run_once()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/base_events.py", line 1424, in _run_once
    handle._run()
  File "/opt/conda/envs/jupyter/lib/python3.6/asyncio/events.py", line 145, in _run
    self._callback(*self._args)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/ioloop.py", line 759, in _run_callback
    ret = callback()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 276, in null_wrapper
    return fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 536, in <lambda>
    self.io_loop.add_callback(lambda : self._handle_events(self.socket, 0))
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 450, in _handle_events
    self._handle_recv()
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 480, in _handle_recv
    self._run_callback(callback, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 432, in _run_callback
    callback(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/stack_context.py", line 315, in wrapped
    ret = fn(*args, **kwargs)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/zmq/eventloop/zmqstream.py", line 196, in <lambda>
    self.on_recv(lambda msg: callback(self, msg), copy=copy)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/services/kernels/handlers.py", line 418, in _on_zmq_reply
    super(ZMQChannelsHandler, self)._on_zmq_reply(stream, msg)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/notebook/base/zmqhandlers.py", line 250, in _on_zmq_reply
    self.write_message(msg, binary=isinstance(msg, bytes))
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 256, in write_message
    return self.ws_connection.write_message(message, binary=binary)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 811, in write_message
    return wrapper()
Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 808, in wrapper
    yield fut
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1099, in run
    value = future.result()
tornado.iostream.StreamClosedError: Stream is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/gen.py", line 1107, in run
    yielded = self.gen.throw(*exc_info)
  File "/opt/conda/envs/jupyter/lib/python3.6/site-packages/tornado/websocket.py", line 810, in wrapper
    raise WebSocketClosedError()
tornado.websocket.WebSocketClosedError
matthiastns commented 6 years ago

I experience slowness of jupyter in general when I work from home, being connected via VPN to our companies network. The slowness is way beyond any potential slowness of the connection. I checked this by accessing the involved systems via other programs. In these cases, jupyter even takes ages to show the folder content, display the notebook, copy a notebook etc. Ages means 1min+ to display the files in the folder, 1 min to open a notebook and so on ... This sometimes occurs also when working on site, what might also be due to special network conditions. I did no further tests or investigations, it is only my impression that this extreme slowness of the whole application, independent from any workload from code, is due to some dedicated network conditions, that kind of "irritate" jupyter.

ihopethiswillfi commented 6 years ago

Hi all, If you're using the Variable Inspector nbextension, disabling it should solve the slowness. It did for me. https://github.com/jupyter/notebook/issues/3224#issuecomment-382300098

shm007g commented 5 years ago

I suffer the same on macOS.

Far more slow than Ipython.

devang191 commented 5 years ago

Try to run cell by cell

pipdax commented 4 years ago

Hi all, If you're using the Variable Inspector nbextension, disabling it should solve the slowness. It did for me. #3224 (comment)

It works for me.Thank you!

Prophet-Barnes commented 3 years ago

@takluyver I have an observation as to why the notebooks are slow. You'd probably find it relevant. Jupyter notebook on my local machine takes a long time to load the libraries for the first time after opening the notebook. This I feel has shot up since I changed my laptop (This system is much more capable though). Only the loading part of libraries takes a gigantic amount of time(for the first time only). The rest of the computation and everything happens butter smooth!

ddi-acassidy commented 2 years ago

Im on windows 10 running Jupyter through Pycharm. In both pycharm and the web portal cells take several seconds to print the output, even just 1+2, even when %%time shows single-digit milliseconds

MosesDastmard commented 2 years ago

I had the same issue. Make sure the line "127.0.0.1 localhost" exists on /etc/hosts (only linux users, I have no idea for Windows users). BTW, I had removed this line to make an application run. Once I recovered it back Jupyter works well again.