ImportError: cannot import name '_ColumnEntity' Ubuntu20.10 [duplicate]
Asked Answered
S

1

5
pip install apache-superset

then I have written

superset db upgrade

I am getting the following error

Traceback (most recent call last):
  File "/home/cod7/superset-env/bin/superset", line 5, in <module>
    from superset.cli import superset
  File "/home/cod7/superset-env/lib/python3.8/site-packages/superset/__init__.py", line 21, in <module>
    from superset.app import create_app
  File "/home/cod7/superset-env/lib/python3.8/site-packages/superset/app.py", line 24, in <module>
    from flask_appbuilder import expose, IndexView
  File "/home/cod7/superset-env/lib/python3.8/site-packages/flask_appbuilder/__init__.py", line 5, in <module>
    from .api import ModelRestApi  # noqa: F401
  File "/home/cod7/superset-env/lib/python3.8/site-packages/flask_appbuilder/api/__init__.py", line 21, in <module>
    from .convert import Model2SchemaConverter
  File "/home/cod7/superset-env/lib/python3.8/site-packages/flask_appbuilder/api/convert.py", line 4, in <module>
    from flask_appbuilder.models.sqla.interface import SQLAInterface
  File "/home/cod7/superset-env/lib/python3.8/site-packages/flask_appbuilder/models/sqla/interface.py", line 16, in <module>
    from sqlalchemy_utils.types.uuid import UUIDType
  File "/home/cod7/superset-env/lib/python3.8/site-packages/sqlalchemy_utils/__init__.py", line 1, in <module>
    from .aggregates import aggregated  # noqa
  File "/home/cod7/superset-env/lib/python3.8/site-packages/sqlalchemy_utils/aggregates.py", line 372, in <module>
    from .functions.orm import get_column_key
  File "/home/cod7/superset-env/lib/python3.8/site-packages/sqlalchemy_utils/functions/__init__.py", line 1, in <module>
    from .database import (  # noqa
  File "/home/cod7/superset-env/lib/python3.8/site-packages/sqlalchemy_utils/functions/database.py", line 11, in <module>
    from .orm import quote
  File "/home/cod7/superset-env/lib/python3.8/site-packages/sqlalchemy_utils/functions/orm.py", line 14, in <module>
    from sqlalchemy.orm.query import _ColumnEntity
ImportError: cannot import name '_ColumnEntity' from 'sqlalchemy.orm.query' (/home/cod7/superset-env/lib/python3.8/site-packages/sqlalchemy/orm/query.py)

please help me guys i am facing this error from long time

Shandra answered 16/3, 2021 at 6:33 Comment(0)
A
11

You have installed SQLAlchemy 1.4.0. SQLAlchemy-utils is currently not compatible with SQLAlchemy > 1.4.0. The solution is to downgrade SQLAlchemy to 1.3.23.

pip install SQLAlchemy==1.3.23

See Temporarily require sqlalchemy <1.4.0 to make compatible with sqlalchemy-utils for some details.

Aurora answered 16/3, 2021 at 8:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.