Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

610
Vistas
ImportError: cannot import name '_ColumnEntity' from 'sqlalchemy.orm.query'

After installing apache-superset using pip in virtual environment, I run:

superset upgrade db   

I run into the following error:

ImportError: cannot import name '_ColumnEntity' from 'sqlalchemy.orm.query' (/Users/ahmedawny/supersetenv/lib/python3.7/site-packages/sqlalchemy/orm/query.py)

Any advice would be appreciated.

over 4 years ago · Hanz Gallego
5 Respuestas
Responde la pregunta

0

If you don't want to modify the requirements file, as recommended in @InsertSpywareTrackingHere's answer, you can manually pip install an older version instead:

pip install sqlalchemy==1.3.24
over 4 years ago · Hanz Gallego Denunciar

0

you can temporarily fix this by changing the imports in sqlalchemy_utils\functions\orm.py:

from sqlalchemy.orm.query import _ColumnEntity

to

from sqlalchemy.orm.context import _ColumnEntity
over 4 years ago · Hanz Gallego Denunciar

0

The core reason for this is that sqlalchemy 1.4 shipped, so it is now the default that pip installs. There were many interface changes and a new query interface added.

So upgrading to 1.4 breaks stuff that depends on the sqlalchemy 1.3 API internals. In your requirements.txt file-- pin the project version to the 1.3.x series until the rest of your stuff catches up. For example, as of this date sqlalchemy-utils is still dependent on sqlalchemy 1.3x.

requirements.txt:

sqlalchemy < 1.4.0

Then use:

pip -r requirements.txt

to "downgrade" to the pinned version.

over 4 years ago · Hanz Gallego Denunciar

0

@InsertSpywareTrackingHere answer is correct, Just want to add that a new release for Flask-AppBuilder was made that pins SQLAlchemy bellow 1.4.0. So installing apache-superset using pip install apache-superset should work now.

over 4 years ago · Hanz Gallego Denunciar

0

Go to sqlalchemy_utils.functions file and change :

  • from sqlalchemy.orm.query import _ColumnEntity (comment this one, or delete it)
  • from sqlalchemy.orm.context import _ColumnEntity (include)

in consequence of this, i belive it should change some stuff along the code...

over 4 years ago · Hanz Gallego Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda