Error: ModuleNotFoundError: No module named 'airflow' | Docker Image Windows WSL2
See original GitHub issueApache Airflow version: 2.0.0
Kubernetes version (if you are using kubernetes) (use kubectl version
): NA
Environment: Local Windows Laptop
- Cloud provider or hardware configuration:
- OS (e.g. from /etc/os-release): Windows 10 (WSL 2)
- Install tools: Docker desktop in Windows 10 (WSL2)
- Others:
What happened:
I am trying to setup local development with Airflow and was using the Docker-compose.yaml file in the repo. I am encountering the below error when I issues the command ‘docker-compose up airflow-init’
Starting airflowdocker_redis_1 … done Starting airflowdocker_postgres_1 … done Starting airflowdocker_airflow-init_1 … done Attaching to airflowdocker_airflow-init_1 airflow-init_1 | DB_BACKEND=postgresql+psycopg2 airflow-init_1 | DB_HOST=postgres airflow-init_1 | DB_PORT=5432 airflow-init_1 | airflow-init_1 | Traceback (most recent call last): airflow-init_1 | File “/home/airflow/.local/bin/airflow”, line 5, in airflow-init_1 | from airflow.main import main airflow-init_1 | ModuleNotFoundError: No module named ‘airflow’ airflowdocker_airflow-init_1 exited with code 1
What you expected to happen: I expected the containers to start and login to airflow via localhost:8080
How to reproduce it: Get the docker-compose.yaml from the repo. and then just follow the instructions on a windows machine.
Anything else we need to know: This occurs everytime
Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (7 by maintainers)
Top GitHub Comments
I had this problem yesterday - it was down to the user config. It was fixed by setting in docker-compose:
Yes i noticed that and accommodated that change. Would like you review it and probably test in another machine. Please let me know.
The airflow init through /bin/bash did not work for me. I had tweak that