docker-airflow icon indicating copy to clipboard operation
docker-airflow copied to clipboard

ModuleNotFoundError: No module named 'wtforms.compat'

Open kurvaraviteja355 opened this issue 3 years ago • 5 comments

When i run the dcoker-compose file i am getting this error and i tried to do pip isntall wtforms in dockerfile, but still its same. Please help me to slove this

ModuleNotFoundError: No module named 'wtforms.compat'

kurvaraviteja355 avatar Dec 07 '21 11:12 kurvaraviteja355

I ran into the same issue. What worked for me was pulling the original docker-airflow image and running it. Once inside the container, you can export the list of packages via pip freeze and then run pip install on that exported file inside your dockerfile. The issue had something to do with the version of WTForms.

brandoncfsx avatar Dec 10 '21 21:12 brandoncfsx

You can change the version of wtforms before building the docker image with the PYTHON_DEPS variable, which should fix the issue.

example in docker compose yaml syntax:

version: '3'
services:
  webserver:
    image: puckel/docker-airflow:1.10.9
    build:
      context: https://github.com/puckel/docker-airflow.git#1.10.9
      dockerfile: Dockerfile
      args:
        AIRFLOW_DEPS: gcp_api,s3
        PYTHON_DEPS: sqlalchemy==1.3.0 wtforms==2.3.3
...

Source: https://stackoverflow.com/questions/69879246/no-module-named-wtforms-compat

charlesfranciscodev avatar Dec 30 '21 20:12 charlesfranciscodev

You can change the version of wtforms before building the docker image with the PYTHON_DEPS variable, which should fix the issue.

example in docker compose yaml syntax:

version: '3'
services:
  webserver:
    image: puckel/docker-airflow:1.10.9
    build:
      context: https://github.com/puckel/docker-airflow.git#1.10.9
      dockerfile: Dockerfile
      args:
        AIRFLOW_DEPS: gcp_api,s3
        PYTHON_DEPS: sqlalchemy==1.3.0 wtforms==2.3.3
...

Source: https://stackoverflow.com/questions/69879246/no-module-named-wtforms-compat

Ran into the same issue yet again. Have downgraded the version of wtforms==2.3.3 and added to the dependencies in the yml file and yet ModuleNotFoundError: No module named 'wtforms.compat' message persists.

srjth19 avatar Jan 13 '22 19:01 srjth19

Pinning the version worked for me as well.

ednarb29 avatar Jan 25 '22 23:01 ednarb29

What exactly did you pin @ednarb29 ?

nabinkhadka avatar Mar 12 '22 06:03 nabinkhadka