导入错误:无法导入名称'_ColumnEntity'Ubuntu20.10
pip install apache-superset
然后我写了
superset db upgrade
我收到以下错误
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)
请帮助我,我长期以来一直面临这个错误
回答
您已经安装了 SQLAlchemy 1.4.0。SQLAlchemy-utils 目前与 SQLAlchemy > 1.4.0 不兼容。解决方案是将 SQLAlchemy 降级到 1.3.23。
pip install SQLAlchemy==1.3.23
有关详细信息,请参阅临时需要 sqlalchemy <1.4.0 以与 sqlalchemy-utils 兼容。
THE END
二维码