# ImportError: cannot import name 'return\_future'

**URL:** <https://discourse.bokeh.org/t/importerror-cannot-import-name-return-future/3410>\
**Category:** Community Support\
**Created:** [March 7, 2019, 12:39am UTC](https://discourse.bokeh.org/t/importerror-cannot-import-name-return-future/3410 "2019-03-07T00:39:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kevin\_Preston](https://discourse.bokeh.org/letter_avatar_proxy/v4/letter/k/e480ec/32.png) [@Kevin\_Preston](https://discourse.bokeh.org/u/Kevin_Preston)\
**Post date:** [March 7, 2019, 12:39am UTC](https://discourse.bokeh.org/t/importerror-cannot-import-name-return-future/3410/1 "2019-03-07T00:39:38Z")

</div>

Error reproduced below: Set up virtual environment with bokeh version 0.13.0, it was working but I reinstalled my environment the same way as before: ‘python3 -m venv [environment name]’ but I receive the error below. Normally I would run the command below for access from web but I used just ‘bokeh serve percpetron.py’ for simplicity and troubleshooting.

bokeh serve perceptron\_plot.py --port XXXX --prefix=/perceptron\_plot --allow-websocket-origin=[www.website.com](http://www.website.com)

Commands are in red. Ubuntu 18.04.2 LTS 64-bit.

> **···**
>
> * * *
> 
> user@server1:/home/jeff/dfenv/df/perceptron\_plot$ python3 -m venv test\_environment
> 
> user@server1:/home/jeff/dfenv/df/perceptron\_plot$ source test\_environment/bin/activate
> 
> (test\_environment) user@server1:/home/jeff/dfenv/df/perceptron\_plot$ pip install bokeh==0.13.0
> 
> **Collecting bokeh==0.13.0**
> 
> **Using cached [https://files.pythonhosted.org/packages/07/1b/1bb751797f0bbbafc2642c629656ce158e7e7b7fb1110f449f7c320fb819/bokeh-0.13.0.tar.gz](https://files.pythonhosted.org/packages/07/1b/1bb751797f0bbbafc2642c629656ce158e7e7b7fb1110f449f7c320fb819/bokeh-0.13.0.tar.gz)**
> 
> **Collecting Jinja2\>=2.7 (from bokeh==0.13.0)**
> 
> **Using cached [https://files.pythonhosted.org/packages/7f/ff/ae64bacdfc95f27a016a7bed8e8686763ba4d277a78ca76f32659220a731/Jinja2-2.10-py2.py3-none-any.whl](https://files.pythonhosted.org/packages/7f/ff/ae64bacdfc95f27a016a7bed8e8686763ba4d277a78ca76f32659220a731/Jinja2-2.10-py2.py3-none-any.whl)**
> 
> **Collecting PyYAML\>=3.10 (from bokeh==0.13.0)**
> 
> **Using cached [https://files.pythonhosted.org/packages/9e/a3/1d13970c3f36777c583f136c136f804d70f500168edc1edea6daa7200769/PyYAML-3.13.tar.gz](https://files.pythonhosted.org/packages/9e/a3/1d13970c3f36777c583f136c136f804d70f500168edc1edea6daa7200769/PyYAML-3.13.tar.gz)**
> 
> **Collecting numpy\>=1.7.1 (from bokeh==0.13.0)**
> 
> **Using cached [https://files.pythonhosted.org/packages/35/d5/4f8410ac303e690144f0a0603c4b8fd3b986feb2749c435f7cdbb288f17e/numpy-1.16.2-cp36-cp36m-manylinux1\_x86\_64.whl](https://files.pythonhosted.org/packages/35/d5/4f8410ac303e690144f0a0603c4b8fd3b986feb2749c435f7cdbb288f17e/numpy-1.16.2-cp36-cp36m-manylinux1_x86_64.whl)**
> 
> **Collecting packaging\>=16.8 (from bokeh==0.13.0)**
> 
> **Using cached [https://files.pythonhosted.org/packages/91/32/58bc30e646e55eab8b21abf89e353f59c0cc02c417e42929f4a9546e1b1d/packaging-19.0-py2.py3-none-any.whl](https://files.pythonhosted.org/packages/91/32/58bc30e646e55eab8b21abf89e353f59c0cc02c417e42929f4a9546e1b1d/packaging-19.0-py2.py3-none-any.whl)**
> 
> **Collecting python-dateutil\>=2.1 (from bokeh==0.13.0)**
> 
> **Using cached [https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python\_dateutil-2.8.0-py2.py3-none-any.whl](https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python_dateutil-2.8.0-py2.py3-none-any.whl)**
> 
> **Collecting six\>=1.5.2 (from bokeh==0.13.0)**
> 
> **Using cached [https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl](https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl)**
> 
> **Collecting tornado\>=4.3 (from bokeh==0.13.0)**
> 
> **Using cached [https://files.pythonhosted.org/packages/b1/7f/8109821ff9df1bf3519169e34646705c32ac13be6a4d51a79ed57f47686e/tornado-6.0.1.tar.gz](https://files.pythonhosted.org/packages/b1/7f/8109821ff9df1bf3519169e34646705c32ac13be6a4d51a79ed57f47686e/tornado-6.0.1.tar.gz)**
> 
> **Collecting MarkupSafe\>=0.23 (from Jinja2\>=2.7-\>bokeh==0.13.0)**
> 
> **Using cached [https://files.pythonhosted.org/packages/b2/5f/23e0023be6bb885d00ffbefad2942bc51a620328ee910f64abe5a8d18dd1/MarkupSafe-1.1.1-cp36-cp36m-manylinux1\_x86\_64.whl](https://files.pythonhosted.org/packages/b2/5f/23e0023be6bb885d00ffbefad2942bc51a620328ee910f64abe5a8d18dd1/MarkupSafe-1.1.1-cp36-cp36m-manylinux1_x86_64.whl)**
> 
> **Collecting pyparsing\>=2.0.2 (from packaging\>=16.8-\>bokeh==0.13.0)**
> 
> **Using cached [https://files.pythonhosted.org/packages/de/0a/001be530836743d8be6c2d85069f46fecf84ac6c18c7f5fb8125ee11d854/pyparsing-2.3.1-py2.py3-none-any.whl](https://files.pythonhosted.org/packages/de/0a/001be530836743d8be6c2d85069f46fecf84ac6c18c7f5fb8125ee11d854/pyparsing-2.3.1-py2.py3-none-any.whl)**
> 
> **Building wheels for collected packages: bokeh, PyYAML, tornado**
> 
> **Running setup.py bdist\_wheel for bokeh … error**
> 
> **Complete output from command /home/jeff/dfenv/dd/perceptron\_plot/test\_environment/bin/python3 -u -c “import setuptools, tokenize;file=’/tmp/pip-build-4zhscx7a/bokeh/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(’\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” bdist\_wheel -d /tmp/tmplyjavr1zpip-wheel- --python-tag cp36:**
> 
> **/usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long\_description\_content\_type’**
> 
> **warnings.warn(msg)**
> 
> **usage: -c [global\_opts] cmd1 [cmd1\_opts] [cmd2 [cmd2\_opts] …]**
> 
> **or: -c --help [cmd1 cmd2 …]**
> 
> **or: -c --help-commands**
> 
> **or: -c cmd --help**
> 
> * * *
> 
> **error: invalid command 'bdist\_wheel’**
> 
> * * *
> 
> **----------------------------------------**
> 
> **Failed building wheel for bokeh**
> 
> **Running setup.py clean for bokeh**
> 
> **Running setup.py bdist\_wheel for PyYAML … error**
> 
> **Complete output from command /home/jeff/dfenv/df/perceptron\_plot/test\_environment/bin/python3 -u -c “import setuptools, tokenize;file=’/tmp/pip-build-4zhscx7a/PyYAML/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(’\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” bdist\_wheel -d /tmp/tmp34bjmwatpip-wheel- --python-tag cp36:**
> 
> **usage: -c [global\_opts] cmd1 [cmd1\_opts] [cmd2 [cmd2\_opts] …]**
> 
> **or: -c --help [cmd1 cmd2 …]**
> 
> **or: -c --help-commands**
> 
> **or: -c cmd --help**
> 
> * * *
> 
> **error: invalid command 'bdist\_wheel’**
> 
> * * *
> 
> **----------------------------------------**
> 
> **Failed building wheel for PyYAML**
> 
> **Running setup.py clean for PyYAML**
> 
> **Running setup.py bdist\_wheel for tornado … error**
> 
> **Complete output from command /home/jeff/dfenv/df/perceptron\_plot/test\_environment/bin/python3 -u -c “import setuptools, tokenize;file=’/tmp/pip-build-4zhscx7a/tornado/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(’\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” bdist\_wheel -d /tmp/tmp7nquk\_38pip-wheel- --python-tag cp36:**
> 
> **usage: -c [global\_opts] cmd1 [cmd1\_opts] [cmd2 [cmd2\_opts] …]**
> 
> **or: -c --help [cmd1 cmd2 …]**
> 
> **or: -c --help-commands**
> 
> **or: -c cmd --help**
> 
> * * *
> 
> **error: invalid command 'bdist\_wheel’**
> 
> * * *
> 
> **----------------------------------------**
> 
> **Failed building wheel for tornado**
> 
> **Running setup.py clean for tornado**
> 
> **Failed to build bokeh PyYAML tornado**
> 
> **Installing collected packages: MarkupSafe, Jinja2, PyYAML, numpy, pyparsing, six, packaging, python-dateutil, tornado, bokeh**
> 
> **Running setup.py install for PyYAML … done**
> 
> **Running setup.py install for tornado … done**
> 
> **Running setup.py install for bokeh … done**
> 
> **Successfully installed Jinja2-2.10 MarkupSafe-1.1.1 PyYAML-3.13 bokeh-0.13.0 numpy-1.16.2 packaging-19.0 pyparsing-2.3.1 python-dateutil-2.8.0 six-1.12.0 tornado-6.0.1**
> 
> (test\_environment) user@server1:/home/jeff/dfenv/df/perceptron\_plot$ bokeh serve perceptron\_plot.py
> 
> **Traceback (most recent call last):**
> 
> **File “/home/jeff/dfenv/df/perceptron\_plot/test\_environment/bin/bokeh”, line 11, in**
> 
> **load\_entry\_point(‘bokeh==0.13.0’, ‘console\_scripts’, ‘bokeh’)()**
> 
> **File “/home/jeff/dfenv/df/perceptron\_plot/test\_environment/lib/python3.6/site-packages/bokeh/main.py”, line 44, in main**
> 
> **from bokeh.command.bootstrap import main as \_main**
> 
> **File “/home/jeff/dfenv/df/perceptron\_plot/test\_environment/lib/python3.6/site-packages/bokeh/command/init.py”, line 18, in**
> 
> **\_build\_docstring()**
> 
> **File “/home/jeff/dfenv/df/perceptron\_plot/test\_environment/lib/python3.6/site-packages/bokeh/command/init.py”, line 10, in \_build\_docstring**
> 
> **from . import subcommands**
> 
> **File “/home/jeff/dfenv/df/perceptron\_plot/test\_environment/lib/python3.6/site-packages/bokeh/command/subcommands/init.py”, line 31, in**
> 
> **all = \_collect()**
> 
> **File “/home/jeff/dfenv/df/perceptron\_plot/test\_environment/lib/python3.6/site-packages/bokeh/command/subcommands/init.py”, line 19, in \_collect**
> 
> **mod = import\_module("." + modname, package)**
> 
> **File “/usr/lib/python3.6/importlib/init.py”, line 126, in import\_module**
> 
> **return \_bootstrap.\_gcd\_import(name[level:], package, level)**
> 
> **File “/home/jeff/dfenv/df/perceptron\_plot/test\_environment/lib/python3.6/site-packages/bokeh/command/subcommands/serve.py”, line 309, in**
> 
> **from bokeh.server.tornado import DEFAULT\_WEBSOCKET\_MAX\_MESSAGE\_SIZE\_BYTES**
> 
> **File “/home/jeff/dfenv/df/perceptron\_plot/test\_environment/lib/python3.6/site-packages/bokeh/server/tornado.py”, line 24, in**
> 
> **from .urls import per\_app\_patterns, toplevel\_patterns**
> 
> **File “/home/jeff/dfenv/df/perceptron\_plot/test\_environment/lib/python3.6/site-packages/bokeh/server/urls.py”, line 39, in**
> 
> **from .views.ws import WSHandler**
> 
> **File “/home/jeff/dfenv/df/perceptron\_plot/test\_environment/lib/python3.6/site-packages/bokeh/server/views/ws.py”, line 20, in**
> 
> **from …protocol.receiver import Receiver**
> 
> **File “/home/jeff/dfenv/df/perceptron\_plot/test\_environment/lib/python3.6/site-packages/bokeh/protocol/receiver.py”, line 8, in**
> 
> **from tornado.concurrent import return\_future**
> 
> **ImportError: cannot import name 'return\_future’**

---

<div class="post-metadata">

**Author:** ![Bryan](https://discourse.bokeh.org/user_avatar/discourse.bokeh.org/bryan/32/3625_2.png) [@Bryan](https://discourse.bokeh.org/u/Bryan)\
**Post date:** [March 7, 2019, 1:02am UTC](https://discourse.bokeh.org/t/importerror-cannot-import-name-return-future/3410/2 "2019-03-07T01:02:19Z")

</div>

Hi,

Tornado 6.x (released a few days ago) removed tornado.concurrent AFAICT, which means it is incompatible with Bokeh 0.13. You will have to either:

\* upgrade to a newer Bokeh version (highly recommend), or  
\* downgrade to an older Tornado version

Thanks,

Bryan

> **···**
>
> > On Mar 6, 2019, at 4:39 PM, kevinapreston@gmail.com wrote:
> > 
> > Error reproduced below: Set up virtual environment with bokeh version 0.13.0, it was working but I reinstalled my environment the same way as before: 'python3 -m venv [environment name]' but I receive the error below. Normally I would run the command below for access from web but I used just 'bokeh serve percpetron.py' for simplicity and troubleshooting.
> > 
> > bokeh serve perceptron\_plot.py --port XXXX --prefix=/perceptron\_plot --allow-websocket-origin=www.website.com
> > 
> > Commands are in red. Ubuntu 18.04.2 LTS 64-bit.
> > 
> > ------------------
> > 
> > user@server1:/home/jeff/dfenv/df/perceptron\_plot$ python3 -m venv test\_environment  
> > user@server1:/home/jeff/dfenv/df/perceptron\_plot$ source test\_environment/bin/activate
> > 
> > (test\_environment) user@server1:/home/jeff/dfenv/df/perceptron\_plot$ pip install bokeh==0.13.0  
> > Collecting bokeh==0.13.0  
> > &nbsp;&nbsp;Using cached [https://files.pythonhosted.org/packages/07/1b/1bb751797f0bbbafc2642c629656ce158e7e7b7fb1110f449f7c320fb819/bokeh-0.13.0.tar.gz](https://files.pythonhosted.org/packages/07/1b/1bb751797f0bbbafc2642c629656ce158e7e7b7fb1110f449f7c320fb819/bokeh-0.13.0.tar.gz)  
> > Collecting Jinja2\>=2.7 (from bokeh==0.13.0)  
> > &nbsp;&nbsp;Using cached [https://files.pythonhosted.org/packages/7f/ff/ae64bacdfc95f27a016a7bed8e8686763ba4d277a78ca76f32659220a731/Jinja2-2.10-py2.py3-none-any.whl](https://files.pythonhosted.org/packages/7f/ff/ae64bacdfc95f27a016a7bed8e8686763ba4d277a78ca76f32659220a731/Jinja2-2.10-py2.py3-none-any.whl)  
> > Collecting PyYAML\>=3.10 (from bokeh==0.13.0)  
> > &nbsp;&nbsp;Using cached [https://files.pythonhosted.org/packages/9e/a3/1d13970c3f36777c583f136c136f804d70f500168edc1edea6daa7200769/PyYAML-3.13.tar.gz](https://files.pythonhosted.org/packages/9e/a3/1d13970c3f36777c583f136c136f804d70f500168edc1edea6daa7200769/PyYAML-3.13.tar.gz)  
> > Collecting numpy\>=1.7.1 (from bokeh==0.13.0)  
> > &nbsp;&nbsp;Using cached [https://files.pythonhosted.org/packages/35/d5/4f8410ac303e690144f0a0603c4b8fd3b986feb2749c435f7cdbb288f17e/numpy-1.16.2-cp36-cp36m-manylinux1\_x86\_64.whl](https://files.pythonhosted.org/packages/35/d5/4f8410ac303e690144f0a0603c4b8fd3b986feb2749c435f7cdbb288f17e/numpy-1.16.2-cp36-cp36m-manylinux1_x86_64.whl)  
> > Collecting packaging\>=16.8 (from bokeh==0.13.0)  
> > &nbsp;&nbsp;Using cached [https://files.pythonhosted.org/packages/91/32/58bc30e646e55eab8b21abf89e353f59c0cc02c417e42929f4a9546e1b1d/packaging-19.0-py2.py3-none-any.whl](https://files.pythonhosted.org/packages/91/32/58bc30e646e55eab8b21abf89e353f59c0cc02c417e42929f4a9546e1b1d/packaging-19.0-py2.py3-none-any.whl)  
> > Collecting python-dateutil\>=2.1 (from bokeh==0.13.0)  
> > &nbsp;&nbsp;Using cached [https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python\_dateutil-2.8.0-py2.py3-none-any.whl](https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python_dateutil-2.8.0-py2.py3-none-any.whl)  
> > Collecting six\>=1.5.2 (from bokeh==0.13.0)  
> > &nbsp;&nbsp;Using cached [https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl](https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl)  
> > Collecting tornado\>=4.3 (from bokeh==0.13.0)  
> > &nbsp;&nbsp;Using cached [https://files.pythonhosted.org/packages/b1/7f/8109821ff9df1bf3519169e34646705c32ac13be6a4d51a79ed57f47686e/tornado-6.0.1.tar.gz](https://files.pythonhosted.org/packages/b1/7f/8109821ff9df1bf3519169e34646705c32ac13be6a4d51a79ed57f47686e/tornado-6.0.1.tar.gz)  
> > Collecting MarkupSafe\>=0.23 (from Jinja2\>=2.7-\>bokeh==0.13.0)  
> > &nbsp;&nbsp;Using cached [https://files.pythonhosted.org/packages/b2/5f/23e0023be6bb885d00ffbefad2942bc51a620328ee910f64abe5a8d18dd1/MarkupSafe-1.1.1-cp36-cp36m-manylinux1\_x86\_64.whl](https://files.pythonhosted.org/packages/b2/5f/23e0023be6bb885d00ffbefad2942bc51a620328ee910f64abe5a8d18dd1/MarkupSafe-1.1.1-cp36-cp36m-manylinux1_x86_64.whl)  
> > Collecting pyparsing\>=2.0.2 (from packaging\>=16.8-\>bokeh==0.13.0)  
> > &nbsp;&nbsp;Using cached [https://files.pythonhosted.org/packages/de/0a/001be530836743d8be6c2d85069f46fecf84ac6c18c7f5fb8125ee11d854/pyparsing-2.3.1-py2.py3-none-any.whl](https://files.pythonhosted.org/packages/de/0a/001be530836743d8be6c2d85069f46fecf84ac6c18c7f5fb8125ee11d854/pyparsing-2.3.1-py2.py3-none-any.whl)  
> > Building wheels for collected packages: bokeh, PyYAML, tornado  
> > &nbsp;&nbsp;Running setup.py bdist\_wheel for bokeh ... error  
> > &nbsp;&nbsp;Complete output from command /home/jeff/dfenv/dd/perceptron\_plot/test\_environment/bin/python3 -u -c "import setuptools, tokenize;\_\_file\_\_='/tmp/pip-build-4zhscx7a/bokeh/setup.py';f=getattr(tokenize, 'open', open)(\_\_file\_\_);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, \_\_file\_\_, 'exec'))" bdist\_wheel -d /tmp/tmplyjavr1zpip-wheel- --python-tag cp36:  
> > &nbsp;&nbsp;/usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long\_description\_content\_type'  
> > &nbsp;&nbsp;&nbsp;&nbsp;warnings.warn(msg)  
> > &nbsp;&nbsp;usage: -c [global\_opts] cmd1 [cmd1\_opts] [cmd2 [cmd2\_opts] ...]  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or: -c --help [cmd1 cmd2 ...]  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or: -c --help-commands  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or: -c cmd --help  
> > &nbsp;&nbsp;  
> > &nbsp;&nbsp;error: invalid command 'bdist\_wheel'  
> > &nbsp;&nbsp;  
> > &nbsp;&nbsp;----------------------------------------  
> > &nbsp;&nbsp;Failed building wheel for bokeh  
> > &nbsp;&nbsp;Running setup.py clean for bokeh  
> > &nbsp;&nbsp;Running setup.py bdist\_wheel for PyYAML ... error  
> > &nbsp;&nbsp;Complete output from command /home/jeff/dfenv/df/perceptron\_plot/test\_environment/bin/python3 -u -c "import setuptools, tokenize;\_\_file\_\_='/tmp/pip-build-4zhscx7a/PyYAML/setup.py';f=getattr(tokenize, 'open', open)(\_\_file\_\_);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, \_\_file\_\_, 'exec'))" bdist\_wheel -d /tmp/tmp34bjmwatpip-wheel- --python-tag cp36:  
> > &nbsp;&nbsp;usage: -c [global\_opts] cmd1 [cmd1\_opts] [cmd2 [cmd2\_opts] ...]  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or: -c --help [cmd1 cmd2 ...]  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or: -c --help-commands  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or: -c cmd --help  
> > &nbsp;&nbsp;  
> > &nbsp;&nbsp;error: invalid command 'bdist\_wheel'  
> > &nbsp;&nbsp;  
> > &nbsp;&nbsp;----------------------------------------  
> > &nbsp;&nbsp;Failed building wheel for PyYAML  
> > &nbsp;&nbsp;Running setup.py clean for PyYAML  
> > &nbsp;&nbsp;Running setup.py bdist\_wheel for tornado ... error  
> > &nbsp;&nbsp;Complete output from command /home/jeff/dfenv/df/perceptron\_plot/test\_environment/bin/python3 -u -c "import setuptools, tokenize;\_\_file\_\_='/tmp/pip-build-4zhscx7a/tornado/setup.py';f=getattr(tokenize, 'open', open)(\_\_file\_\_);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, \_\_file\_\_, 'exec'))" bdist\_wheel -d /tmp/tmp7nquk\_38pip-wheel- --python-tag cp36:  
> > &nbsp;&nbsp;usage: -c [global\_opts] cmd1 [cmd1\_opts] [cmd2 [cmd2\_opts] ...]  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or: -c --help [cmd1 cmd2 ...]  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or: -c --help-commands  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or: -c cmd --help  
> > &nbsp;&nbsp;  
> > &nbsp;&nbsp;error: invalid command 'bdist\_wheel'  
> > &nbsp;&nbsp;  
> > &nbsp;&nbsp;----------------------------------------  
> > &nbsp;&nbsp;Failed building wheel for tornado  
> > &nbsp;&nbsp;Running setup.py clean for tornado  
> > Failed to build bokeh PyYAML tornado  
> > Installing collected packages: MarkupSafe, Jinja2, PyYAML, numpy, pyparsing, six, packaging, python-dateutil, tornado, bokeh  
> > &nbsp;&nbsp;Running setup.py install for PyYAML ... done  
> > &nbsp;&nbsp;Running setup.py install for tornado ... done  
> > &nbsp;&nbsp;Running setup.py install for bokeh ... done  
> > Successfully installed Jinja2-2.10 MarkupSafe-1.1.1 PyYAML-3.13 bokeh-0.13.0 numpy-1.16.2 packaging-19.0 pyparsing-2.3.1 python-dateutil-2.8.0 six-1.12.0 tornado-6.0.1  
> > (test\_environment) user@server1:/home/jeff/dfenv/df/perceptron\_plot$ bokeh serve perceptron\_plot.py  
> > Traceback (most recent call last):  
> > &nbsp;&nbsp;File "/home/jeff/dfenv/df/perceptron\_plot/test\_environment/bin/bokeh", line 11, in \<module\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;load\_entry\_point('bokeh==0.13.0', 'console\_scripts', 'bokeh')()  
> > &nbsp;&nbsp;File "/home/jeff/dfenv/df/perceptron\_plot/test\_environment/lib/python3.6/site-packages/bokeh/\_\_main\_\_.py", line 44, in main  
> > &nbsp;&nbsp;&nbsp;&nbsp;from bokeh.command.bootstrap import main as \_main  
> > &nbsp;&nbsp;File "/home/jeff/dfenv/df/perceptron\_plot/test\_environment/lib/python3.6/site-packages/bokeh/command/\_\_init\_\_.py", line 18, in \<module\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\_build\_docstring()  
> > &nbsp;&nbsp;File "/home/jeff/dfenv/df/perceptron\_plot/test\_environment/lib/python3.6/site-packages/bokeh/command/\_\_init\_\_.py", line 10, in \_build\_docstring  
> > &nbsp;&nbsp;&nbsp;&nbsp;from . import subcommands  
> > &nbsp;&nbsp;File "/home/jeff/dfenv/df/perceptron\_plot/test\_environment/lib/python3.6/site-packages/bokeh/command/subcommands/\_\_init\_\_.py", line 31, in \<module\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;all = \_collect()  
> > &nbsp;&nbsp;File "/home/jeff/dfenv/df/perceptron\_plot/test\_environment/lib/python3.6/site-packages/bokeh/command/subcommands/\_\_init\_\_.py", line 19, in \_collect  
> > &nbsp;&nbsp;&nbsp;&nbsp;mod = import\_module("." + modname, \_\_package\_\_)  
> > &nbsp;&nbsp;File "/usr/lib/python3.6/importlib/\_\_init\_\_.py", line 126, in import\_module  
> > &nbsp;&nbsp;&nbsp;&nbsp;return \_bootstrap.\_gcd\_import(name[level:], package, level)  
> > &nbsp;&nbsp;File "/home/jeff/dfenv/df/perceptron\_plot/test\_environment/lib/python3.6/site-packages/bokeh/command/subcommands/serve.py", line 309, in \<module\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;from bokeh.server.tornado import DEFAULT\_WEBSOCKET\_MAX\_MESSAGE\_SIZE\_BYTES  
> > &nbsp;&nbsp;File "/home/jeff/dfenv/df/perceptron\_plot/test\_environment/lib/python3.6/site-packages/bokeh/server/tornado.py", line 24, in \<module\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;from .urls import per\_app\_patterns, toplevel\_patterns  
> > &nbsp;&nbsp;File "/home/jeff/dfenv/df/perceptron\_plot/test\_environment/lib/python3.6/site-packages/bokeh/server/urls.py", line 39, in \<module\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;from .views.ws import WSHandler  
> > &nbsp;&nbsp;File "/home/jeff/dfenv/df/perceptron\_plot/test\_environment/lib/python3.6/site-packages/bokeh/server/views/ws.py", line 20, in \<module\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;from ...protocol.receiver import Receiver  
> > &nbsp;&nbsp;File "/home/jeff/dfenv/df/perceptron\_plot/test\_environment/lib/python3.6/site-packages/bokeh/protocol/receiver.py", line 8, in \<module\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;from tornado.concurrent import return\_future  
> > ImportError: cannot import name 'return\_future'
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+unsubscribe@continuum.io.  
> > To post to this group, send email to bokeh@continuum.io.  
> > To view this discussion on the web visit [https://groups.google.com/a/continuum.io/d/msgid/bokeh/f7975dfe-261f-40ca-a17c-5a7ce22828e8%40continuum.io\](https://groups.google.com/a/continuum.io/d/msgid/bokeh/f7975dfe-261f-40ca-a17c-5a7ce22828e8%40continuum.io%5C).  
> > For more options, visit [https://groups.google.com/a/continuum.io/d/optout\](https://groups.google.com/a/continuum.io/d/optout%5C).

---

<div class="post-metadata">

**Author:** ![Kevin\_Preston](https://discourse.bokeh.org/letter_avatar_proxy/v4/letter/k/e480ec/32.png) [@Kevin\_Preston](https://discourse.bokeh.org/u/Kevin_Preston)\
**Post date:** [March 7, 2019, 2:50am UTC](https://discourse.bokeh.org/t/importerror-cannot-import-name-return-future/3410/3 "2019-03-07T02:50:01Z")

</div>

Yup, I was already about to close this discussion… indeed, I downgraded to older tornado version and it worked.

> **···**
>
> On Wednesday, March 6, 2019 at 5:02:25 PM UTC-8, Bryan Van de ven wrote:
> 
> > Hi,
> > 
> > Tornado 6.x (released a few days ago) removed tornado.concurrent AFAICT, which means it is incompatible with Bokeh 0.13. You will have to either:
> > 
> > - upgrade to a newer Bokeh version (highly recommend), or
> > 
> > - downgrade to an older Tornado version
> > 
> > Thanks,
> > 
> > Bryan
> > 
> > > On Mar 6, 2019, at 4:39 PM, [kevina...@gmail.com](mailto:kevina...@gmail.com) wrote:
> > 
> > > Error reproduced below: Set up virtual environment with bokeh version 0.13.0, it was working but I reinstalled my environment the same way as before: ‘python3 -m venv [environment name]’ but I receive the error below. Normally I would run the command below for access from web but I used just ‘bokeh serve percpetron.py’ for simplicity and troubleshooting.
> > 
> > > bokeh serve perceptron\_plot.py --port XXXX --prefix=/perceptron\_plot --allow-websocket-origin=[www.website.com](http://www.website.com)
> > 
> > > Commands are in red. Ubuntu 18.04.2 LTS 64-bit.
> > > 
> > > * * *
> > 
> > > user@server1:/home/jeff/dfenv/df/perceptron\_plot$ python3 -m venv test\_environment
> > 
> > > user@server1:/home/jeff/dfenv/df/perceptron\_plot$ source test\_environment/bin/activate
> > 
> > > (test\_environment) user@server1:/home/jeff/dfenv/df/perceptron\_plot$ pip install bokeh==0.13.0
> > 
> > > Collecting bokeh==0.13.0
> > 
> > > Using cached [https://files.pythonhosted.org/packages/07/1b/1bb751797f0bbbafc2642c629656ce158e7e7b7fb1110f449f7c320fb819/bokeh-0.13.0.tar.gz](https://files.pythonhosted.org/packages/07/1b/1bb751797f0bbbafc2642c629656ce158e7e7b7fb1110f449f7c320fb819/bokeh-0.13.0.tar.gz)
> > 
> > > Collecting Jinja2\>=2.7 (from bokeh==0.13.0)
> > 
> > > Using cached [https://files.pythonhosted.org/packages/7f/ff/ae64bacdfc95f27a016a7bed8e8686763ba4d277a78ca76f32659220a731/Jinja2-2.10-py2.py3-none-any.whl](https://files.pythonhosted.org/packages/7f/ff/ae64bacdfc95f27a016a7bed8e8686763ba4d277a78ca76f32659220a731/Jinja2-2.10-py2.py3-none-any.whl)
> > 
> > > Collecting PyYAML\>=3.10 (from bokeh==0.13.0)
> > 
> > > Using cached [https://files.pythonhosted.org/packages/9e/a3/1d13970c3f36777c583f136c136f804d70f500168edc1edea6daa7200769/PyYAML-3.13.tar.gz](https://files.pythonhosted.org/packages/9e/a3/1d13970c3f36777c583f136c136f804d70f500168edc1edea6daa7200769/PyYAML-3.13.tar.gz)
> > 
> > > Collecting numpy\>=1.7.1 (from bokeh==0.13.0)
> > 
> > > Using cached [https://files.pythonhosted.org/packages/35/d5/4f8410ac303e690144f0a0603c4b8fd3b986feb2749c435f7cdbb288f17e/numpy-1.16.2-cp36-cp36m-manylinux1\_x86\_64.whl](https://files.pythonhosted.org/packages/35/d5/4f8410ac303e690144f0a0603c4b8fd3b986feb2749c435f7cdbb288f17e/numpy-1.16.2-cp36-cp36m-manylinux1_x86_64.whl)
> > 
> > > Collecting packaging\>=16.8 (from bokeh==0.13.0)
> > 
> > > Using cached [https://files.pythonhosted.org/packages/91/32/58bc30e646e55eab8b21abf89e353f59c0cc02c417e42929f4a9546e1b1d/packaging-19.0-py2.py3-none-any.whl](https://files.pythonhosted.org/packages/91/32/58bc30e646e55eab8b21abf89e353f59c0cc02c417e42929f4a9546e1b1d/packaging-19.0-py2.py3-none-any.whl)
> > 
> > > Collecting python-dateutil\>=2.1 (from bokeh==0.13.0)
> > 
> > > Using cached [https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python\_dateutil-2.8.0-py2.py3-none-any.whl](https://files.pythonhosted.org/packages/41/17/c62faccbfbd163c7f57f3844689e3a78bae1f403648a6afb1d0866d87fbb/python_dateutil-2.8.0-py2.py3-none-any.whl)
> > 
> > > Collecting six\>=1.5.2 (from bokeh==0.13.0)
> > 
> > > Using cached [https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl](https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl)
> > 
> > > Collecting tornado\>=4.3 (from bokeh==0.13.0)
> > 
> > > Using cached [https://files.pythonhosted.org/packages/b1/7f/8109821ff9df1bf3519169e34646705c32ac13be6a4d51a79ed57f47686e/tornado-6.0.1.tar.gz](https://files.pythonhosted.org/packages/b1/7f/8109821ff9df1bf3519169e34646705c32ac13be6a4d51a79ed57f47686e/tornado-6.0.1.tar.gz)
> > 
> > > Collecting MarkupSafe\>=0.23 (from Jinja2\>=2.7-\>bokeh==0.13.0)
> > 
> > > Using cached [https://files.pythonhosted.org/packages/b2/5f/23e0023be6bb885d00ffbefad2942bc51a620328ee910f64abe5a8d18dd1/MarkupSafe-1.1.1-cp36-cp36m-manylinux1\_x86\_64.whl](https://files.pythonhosted.org/packages/b2/5f/23e0023be6bb885d00ffbefad2942bc51a620328ee910f64abe5a8d18dd1/MarkupSafe-1.1.1-cp36-cp36m-manylinux1_x86_64.whl)
> > 
> > > Collecting pyparsing\>=2.0.2 (from packaging\>=16.8-\>bokeh==0.13.0)
> > 
> > > Using cached [https://files.pythonhosted.org/packages/de/0a/001be530836743d8be6c2d85069f46fecf84ac6c18c7f5fb8125ee11d854/pyparsing-2.3.1-py2.py3-none-any.whl](https://files.pythonhosted.org/packages/de/0a/001be530836743d8be6c2d85069f46fecf84ac6c18c7f5fb8125ee11d854/pyparsing-2.3.1-py2.py3-none-any.whl)
> > 
> > > Building wheels for collected packages: bokeh, PyYAML, tornado
> > 
> > > Running setup.py bdist\_wheel for bokeh … error
> > 
> > > Complete output from command /home/jeff/dfenv/dd/perceptron\_plot/test\_environment/bin/python3 -u -c “import setuptools, tokenize; **file** =‘/tmp/pip-build-4zhscx7a/bokeh/setup.py’;f=getattr(tokenize, ‘open’, open)( **file** );code=f.read().replace(‘\r\n’, ‘\n’);f.close();exec(compile(code, **file** , ‘exec’))” bdist\_wheel -d /tmp/tmplyjavr1zpip-wheel- --python-tag cp36:
> > 
> > > /usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: ‘long\_description\_content\_type’
> > 
> > > ```
> > > warnings.warn(msg)
> > > 
> > > ```
> > 
> > > usage: -c [global\_opts] cmd1 [cmd1\_opts] [cmd2 [cmd2\_opts] …]
> > 
> > > ```
> > > or: -c --help [cmd1 cmd2 ...]
> > > 
> > > ```
> > 
> > > ```
> > > or: -c --help-commands
> > > 
> > > ```
> > 
> > > ```
> > > or: -c cmd --help
> > > 
> > > ```
> > 
> > > error: invalid command ‘bdist\_wheel’
> > 
> > > * * *
> > 
> > > Failed building wheel for bokeh
> > 
> > > Running setup.py clean for bokeh
> > 
> > > Running setup.py bdist\_wheel for PyYAML … error
> > 
> > > Complete output from command /home/jeff/dfenv/df/perceptron\_plot/test\_environment/bin/python3 -u -c “import setuptools, tokenize; **file** =‘/tmp/pip-build-4zhscx7a/PyYAML/setup.py’;f=getattr(tokenize, ‘open’, open)( **file** );code=f.read().replace(‘\r\n’, ‘\n’);f.close();exec(compile(code, **file** , ‘exec’))” bdist\_wheel -d /tmp/tmp34bjmwatpip-wheel- --python-tag cp36:
> > 
> > > usage: -c [global\_opts] cmd1 [cmd1\_opts] [cmd2 [cmd2\_opts] …]
> > 
> > > ```
> > > or: -c --help [cmd1 cmd2 ...]
> > > 
> > > ```
> > 
> > > ```
> > > or: -c --help-commands
> > > 
> > > ```
> > 
> > > ```
> > > or: -c cmd --help
> > > 
> > > ```
> > 
> > > error: invalid command ‘bdist\_wheel’
> > 
> > > * * *
> > 
> > > Failed building wheel for PyYAML
> > 
> > > Running setup.py clean for PyYAML
> > 
> > > Running setup.py bdist\_wheel for tornado … error
> > 
> > > Complete output from command /home/jeff/dfenv/df/perceptron\_plot/test\_environment/bin/python3 -u -c “import setuptools, tokenize; **file** =‘/tmp/pip-build-4zhscx7a/tornado/setup.py’;f=getattr(tokenize, ‘open’, open)( **file** );code=f.read().replace(‘\r\n’, ‘\n’);f.close();exec(compile(code, **file** , ‘exec’))” bdist\_wheel -d /tmp/tmp7nquk\_38pip-wheel- --python-tag cp36:
> > 
> > > usage: -c [global\_opts] cmd1 [cmd1\_opts] [cmd2 [cmd2\_opts] …]
> > 
> > > ```
> > > or: -c --help [cmd1 cmd2 ...]
> > > 
> > > ```
> > 
> > > ```
> > > or: -c --help-commands
> > > 
> > > ```
> > 
> > > ```
> > > or: -c cmd --help
> > > 
> > > ```
> > 
> > > error: invalid command ‘bdist\_wheel’
> > 
> > > * * *
> > 
> > > Failed building wheel for tornado
> > 
> > > Running setup.py clean for tornado
> > 
> > > Failed to build bokeh PyYAML tornado
> > 
> > > Installing collected packages: MarkupSafe, Jinja2, PyYAML, numpy, pyparsing, six, packaging, python-dateutil, tornado, bokeh
> > 
> > > Running setup.py install for PyYAML … done
> > 
> > > Running setup.py install for tornado … done
> > 
> > > Running setup.py install for bokeh … done
> > 
> > > Successfully installed Jinja2-2.10 MarkupSafe-1.1.1 PyYAML-3.13 bokeh-0.13.0 numpy-1.16.2 packaging-19.0 pyparsing-2.3.1 python-dateutil-2.8.0 six-1.12.0 tornado-6.0.1
> > 
> > > (test\_environment) user@server1:/home/jeff/dfenv/df/perceptron\_plot$ bokeh serve perceptron\_plot.py
> > 
> > > Traceback (most recent call last):
> > 
> > > File “/home/jeff/dfenv/df/perceptron\_plot/test\_environment/bin/bokeh”, line 11, in
> > 
> > > ```
> > > load_entry_point('bokeh==0.13.0', 'console_scripts', 'bokeh')()
> > > 
> > > ```
> > 
> > > File “/home/jeff/dfenv/df/perceptron\_plot/test\_environment/lib/python3.6/site-packages/bokeh/ **main**.py”, line 44, in main
> > 
> > > ```
> > > from bokeh.command.bootstrap import main as _main
> > > 
> > > ```
> > 
> > > File “/home/jeff/dfenv/df/perceptron\_plot/test\_environment/lib/python3.6/site-packages/bokeh/command/ **init**.py”, line 18, in
> > 
> > > ```
> > > _build_docstring()
> > > 
> > > ```
> > 
> > > File “/home/jeff/dfenv/df/perceptron\_plot/test\_environment/lib/python3.6/site-packages/bokeh/command/ **init**.py”, line 10, in \_build\_docstring
> > 
> > > ```
> > > from . import subcommands
> > > 
> > > ```
> > 
> > > File “/home/jeff/dfenv/df/perceptron\_plot/test\_environment/lib/python3.6/site-packages/bokeh/command/subcommands/ **init**.py”, line 31, in
> > 
> > > ```
> > > all = _collect()
> > > 
> > > ```
> > 
> > > File “/home/jeff/dfenv/df/perceptron\_plot/test\_environment/lib/python3.6/site-packages/bokeh/command/subcommands/ **init**.py”, line 19, in \_collect
> > 
> > > ```
> > > mod = import_module("." + modname, __package__ )
> > > 
> > > ```
> > 
> > > File “/usr/lib/python3.6/importlib/ **init**.py”, line 126, in import\_module
> > 
> > > ```
> > > return _bootstrap._gcd_import(name[level:], package, level)
> > > 
> > > ```
> > 
> > > File “/home/jeff/dfenv/df/perceptron\_plot/test\_environment/lib/python3.6/site-packages/bokeh/command/subcommands/serve.py”, line 309, in
> > 
> > > ```
> > > from bokeh.server.tornado import DEFAULT_WEBSOCKET_MAX_MESSAGE_SIZE_BYTES
> > > 
> > > ```
> > 
> > > File “/home/jeff/dfenv/df/perceptron\_plot/test\_environment/lib/python3.6/site-packages/bokeh/server/tornado.py”, line 24, in
> > 
> > > ```
> > > from .urls import per_app_patterns, toplevel_patterns
> > > 
> > > ```
> > 
> > > File “/home/jeff/dfenv/df/perceptron\_plot/test\_environment/lib/python3.6/site-packages/bokeh/server/urls.py”, line 39, in
> > 
> > > ```
> > > from .[views.ws](http://views.ws) import WSHandler
> > > 
> > > ```
> > 
> > > File “/home/jeff/dfenv/df/perceptron\_plot/test\_environment/lib/python3.6/site-packages/bokeh/server/views/ws.py”, line 20, in
> > 
> > > ```
> > > from ...protocol.receiver import Receiver
> > > 
> > > ```
> > 
> > > File “/home/jeff/dfenv/df/perceptron\_plot/test\_environment/lib/python3.6/site-packages/bokeh/protocol/receiver.py”, line 8, in
> > 
> > > ```
> > > from tornado.concurrent import return_future
> > > 
> > > ```
> > 
> > > ImportError: cannot import name ‘return\_future’
> > 
> > > –  
> > > You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
> > 
> > > To unsubscribe from this group and stop receiving emails from it, send an email to [bokeh+un...@continuum.io](mailto:bokeh+un...@continuum.io).
> > 
> > > To post to this group, send email to [bo...@continuum.io](mailto:bo...@continuum.io).
> > 
> > > To view this discussion on the web visit [https://groups.google.com/a/continuum.io/d/msgid/bokeh/f7975dfe-261f-40ca-a17c-5a7ce22828e8%40continuum.io](https://groups.google.com/a/continuum.io/d/msgid/bokeh/f7975dfe-261f-40ca-a17c-5a7ce22828e8%40continuum.io).
> > 
> > > For more options, visit [https://groups.google.com/a/continuum.io/d/optout](https://groups.google.com/a/continuum.io/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://discourse-uploads.bokeh.org/original/2X/1/14eb24f9e10e4e9b78e3f10f66c04ffa96446e5a.svg) [@system](https://discourse.bokeh.org/u/system)\
**Post date:** [July 21, 2021, 9:16pm UTC](https://discourse.bokeh.org/t/importerror-cannot-import-name-return-future/3410/4 "2021-07-21T21:16:39Z")

</div>


