Incubator-superset: Error importing _maybe_box_datetimelike/maybe_box_datetimelike

Created on 17 Jul 2019  路  2Comments  路  Source: apache/incubator-superset

OS: Ubuntu 18.04

When you try and run Superset within the /incubator-superset/superset/ directory using the command

sudo FLASK_ENV=development superset run -p 8088 --with-threads --reload --debugger

It may output the following error:

Traceback (most recent call last):
  File "/usr/local/bin/superset", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/home/andreas/incubator-superset/superset/bin/superset", line 21, in <module>
    from superset.cli import create_app
  File "/home/andreas/incubator-superset/superset/__init__.py", line 251, in <module>
    from superset import views  # noqa
  File "/home/andreas/incubator-superset/superset/views/__init__.py", line 19, in <module>
    from . import core  # noqa
  File "/home/andreas/incubator-superset/superset/views/core.py", line 52, in <module>
    from superset import (
  File "/home/andreas/incubator-superset/superset/sql_lab.py", line 32, in <module>
    from superset import app, dataframe, db, results_backend, security_manager
  File "/home/andreas/incubator-superset/superset/dataframe.py", line 30, in <module>
    from pandas.core.common import _maybe_box_datetimelike as maybe_box_datetimelike
ImportError: cannot import name '_maybe_box_datetimelike'

However, when you try and run Superset from the incubator-superset/contrib/docker directory using the command

sudo docker-compose run --rm superset ./docker-init.sh

It may output the following error:

Error: While importing "superset", an ImportError was raised:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/flask/cli.py", line 235, in locate_app
    __import__(module_name)
  File "/home/superset/superset/__init__.py", line 251, in <module>
    from superset import views  # noqa
  File "/home/superset/superset/views/__init__.py", line 19, in <module>
    from . import core  # noqa
  File "/home/superset/superset/views/core.py", line 52, in <module>
    from superset import (
  File "/home/superset/superset/sql_lab.py", line 32, in <module>
    from superset import app, dataframe, db, results_backend, security_manager
  File "/home/superset/superset/dataframe.py", line 30, in <module>
    from pandas.core.common import maybe_box_datetimelike
ImportError: cannot import name 'maybe_box_datetimelike'

The errors are inconsistent - one way of building Superset imports maybe_box_datetimelike, while the other imports _maybe_box_datetimelike.. As the code is now, at least one of the methods for building Superset will not work (depending on what you import in superset/dataframe.py)

#bug

Most helpful comment

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.95. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

All 2 comments

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.95. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

Closing this (see comments in PR)

Was this page helpful?
0 / 5 - 0 ratings