puckel / docker-airflow

Docker Apache Airflow
Apache License 2.0
3.77k stars 535 forks source link

ModuleNotFoundError: No module named 'wtforms.compat' #649

Open kurvaraviteja355 opened 2 years ago

kurvaraviteja355 commented 2 years ago

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'

brandoncfsx commented 2 years ago

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.

charlesfranciscodev commented 2 years ago

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

srjth19 commented 2 years ago

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.

ednarb29 commented 2 years ago

Pinning the version worked for me as well.

nabinkhadka commented 2 years ago

What exactly did you pin @ednarb29 ?