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

387
Vistas
ImportError: cannot import name 'MutableMapping' from 'collections' (/usr/local/lib/python3.10/collections/__init__.py)

I'm running this simple flask app in vs code. Dockerized it and loaded to ECS. The task is exiting with the following error:

ImportError: cannot import name 'MutableMapping' from 'collections' (/usr/local/lib/python3.10/collections/init.py)

The base image I'm using is python3.10.

Following is the dockerfile code:

FROM python:3.10
WORKDIR /usr/src/app
COPY . .
RUN pip install --no-cache-dir -r requirements.txt
EXPOSE 5000

Why am I getting this error?

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

0

Trying the following in python 3.9:

>>> from collections import MutableMapping
<stdin>:1: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working

So I'm guessing your problem is you're using python 3.10 where you need to do:

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

0

if you update the flask package to >=2.0 it will import it correctly also in python 3.10

over 4 years ago · Santiago Trujillo Denunciar

0

Looks like you're doing the same docker tutorial that I am.

@geza.denes is right, we need flask 2.0 or greater.

you can update this in flask-app/requirements.txt

Rebuild your docker image and run it again, should work!

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