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

401
Vistas
in VS Code ImportError: cannot import name 'Mapping' from 'collections'

I am trying to connect to Postgress and create a folder test.db via Flask. When I run "python3" in the terminal and from there when I run "from app import db" I get an import error:

ImportError: cannot import name 'Mapping' from 'collections' (/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/collections/__init__.py)

I have tried all the troubleshooting but none of them worked. Please advise. Here is the full stack: full stack error

over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

As Mitra said above, change:

from collections import Mapping

to

from collections.abc import Mapping
over 4 years ago · Santiago Trujillo Denunciar

0

As stated by others, this is caused by a change in the collections interface starting with Python 3.10. As far as I can see there are three options to mitigate this issue so far:

  • Revert to Python 3.9.

  • If the error occurs in a third-party library, try to update this library first (pip install <package> --upgrade).

  • Patch the code manually.

    For patching the ImportError, see https://stackoverflow.com/a/69727802/13994294.

over 4 years ago · Santiago Trujillo Denunciar

0

Use older version of python (eg 3.8)

over 4 years ago · Santiago Trujillo 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