ImportError: cannot import name bytes_type

Issue Summary

[root@localhost redash-8.0.0]# docker-compose run --rm server create_db
Starting redash-800_postgres_1 … done
Starting redash-800_redis_1 … done

/usr/local/lib/python2.7/site-packages/sqlalchemy/sql/ SAWarning: The GenericFunction ‘array_agg’ is already registered and is going to be overriden.
“is going to be overriden.”.format(identifier)
Traceback (most recent call last):
File “/app/”, line 9, in
File “/usr/local/lib/python2.7/site-packages/click/”, line 716, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/site-packages/flask/”, line 380, in main
return AppGroup.main(self, *args, **kwargs)
File “/usr/local/lib/python2.7/site-packages/click/”, line 696, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/site-packages/click/”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/site-packages/click/”, line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/site-packages/click/”, line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/site-packages/click/”, line 534, in invoke
return callback(*args, **kwargs)
File “/usr/local/lib/python2.7/site-packages/click/”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/usr/local/lib/python2.7/site-packages/flask/”, line 256, in decorator
with __ctx.ensure_object(ScriptInfo).load_app().app_context():
File “/usr/local/lib/python2.7/site-packages/flask/”, line 229, in load_app
rv = self.create_app(self)
File “/app/redash/cli/”, line 14, in create
app = current_app or create_app()
File “/app/redash/”, line 42, in create_app
File “/app/redash/authentication/”, line 226, in init_app
from redash.authentication import google_oauth, saml_auth, remote_user_auth, ldap_auth
File “/app/redash/authentication/”, line 4, in
from flask_oauthlib.client import OAuth
File “/usr/local/lib/python2.7/site-packages/flask_oauthlib/”, line 20, in
from .utils import to_bytes
File “/usr/local/lib/python2.7/site-packages/flask_oauthlib/”, line 5, in
from oauthlib.common import to_unicode, bytes_type
ImportError: cannot import name bytes_type

Technical details:

  • Redash Version: 8.0
  • Browser/OS: red hat 4.8
  • How did you install Redash: docker

Try updating to requests-oauthlib==1.1.0 in requirements.txt.