"jupyter_collab_storage" has problem with latest tornado package


#1

jupyter_collab_storage package makes use of the tornado package, but not compatible with its latest version: tornado==5.0.1. We get the following error:

/opt/conda/envs/python2/lib/python2.7/site-packages/jupyter_collab_storage/oauth_token_handler.pyc in get_token()
     68                       body=urlencode(params))
     69 
---> 70     http_client = HTTPClient()
     71     try:
     72         resp = http_client.fetch(req)

/opt/conda/envs/python2/lib/python2.7/site-packages/tornado/httpclient.pyc in __init__(self, async_client_class, **kwargs)
     76         if async_client_class is None:
     77             async_client_class = AsyncHTTPClient
---> 78         # Create the client while our IOLoop is "current", without
     79         # clobbering the thread's real current IOLoop (if any).
     80         self._async_client = self._io_loop.run_sync(

/opt/conda/envs/python2/lib/python2.7/site-packages/tornado/httpclient.pyc in __new__(cls, io_loop, force_instance, **kwargs)
    166             instance_cache = None
    167         else:
--> 168             instance_cache = cls._async_clients()
    169         if instance_cache is not None and io_loop in instance_cache:
    170             return instance_cache[io_loop]

/opt/conda/envs/python2/lib/python2.7/site-packages/tornado/util.pyc in __new__(cls, *args, **kwargs)
    281 
    282     Configurable subclasses must define the class methods
--> 283     `configurable_base` and `configurable_default`, and use the instance
    284     method `initialize` instead of ``__init__``.
    285 

/opt/conda/envs/python2/lib/python2.7/site-packages/tornado/util.pyc in configured_class(cls)
    345         # type: (Any, **Any) -> None
    346         """Sets the class to use when the base class is instantiated.
--> 347 
    348         Keyword arguments will be saved and added to the arguments passed
    349         to the constructor.  This can be used to set global defaults for

/opt/conda/envs/python2/lib/python2.7/site-packages/tornado/httpclient.pyc in configurable_default(cls)
    147     @classmethod
    148     def configurable_base(cls):
--> 149         return AsyncHTTPClient
    150 
    151     @classmethod

/opt/conda/envs/python2/lib/python2.7/site-packages/tornado/simple_httpclient.py in <module>()
     11 from tornado.log import gen_log
     12 from tornado import stack_context
---> 13 from tornado.tcpclient import TCPClient
     14 from tornado.util import PY3
     15 

/opt/conda/envs/python2/lib/python2.7/site-packages/tornado/tcpclient.py in <module>()
     23 import datetime
     24 
---> 25 from tornado.concurrent import Future, future_add_done_callback
     26 from tornado.ioloop import IOLoop
     27 from tornado.iostream import IOStream

ImportError: cannot import name future_add_done_callback

Current workaround: installing an older version of Tornado (4.5.3):

pip uninstall tornado
pip install tornado==4.5.3