-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: ModuleNotFoundError: No module named 'airflow' | Docker Image Windows WSL2 #14111
Comments
Thanks for opening your first issue here! Be sure to follow the issue template! |
I had this problem yesterday - it was down to the user config. It was fixed by setting in docker-compose:
|
@turbaszek I changed the user config but I still seem to get the same error. Is there any other change that you missed to mention? |
@turbaszek I was able to fix the error. airflowdocker_postgres_1 is up-to-date |
@anilkulkarni87 can you share your docker-compose? CC @mik-laj who's the author of this docker-compose 🐈 |
Here is the file. @turbaszek
|
@turbaszek Windows is not yet supported and this file has not been tested in any way on this system. Unfortunately docker-compose for Windows is very limited and buggy. Other projects provide virtual machine images as the recommended method for using their projects on Windows. For example, Superset:
https://superset.apache.org/docs/installation/installing-superset-using-docker-compose We should probably describe what Windows support looks like and prepare workarounds. We even have a ticket about it: I recently bought a few computers with Windows and when time permits I will experiment with it a bit. |
@mik-laj Thanks for the update. I am currently using the Ubuntu on WSL2 in Windows 10 home. I was able to get it working with some small tweaks to the original docker-compose.yaml and tried my best to make it simpler. I captured as much info I could and saved it in my repo. Please review(the changes in the docker-compose.yaml and would be great if you could test this in other machines) and then maybe we could just close this. I am just happy that I got it working for now. |
As for docker-compose.yaml, depending on the Airflow version, we have different files. The main difference is a different command in the airflow-init service. |
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 |
Experiencing the same issue in ubuntu. And for 2.0.1 compose file, the default image tag is not complete:
Should be airflow:2.0.1-python3.8
|
@mik-laj Where can i find the code that does airflow-init? Setting
|
@anilkulkarni87 see: https://github.com/apache/airflow/pull/13728/files |
@mik-laj I think we could close this. I just tried the latest docker-compose on windows (WSL2 - Ubuntu) It works as expected. No issues at all. |
Closing. BTW. Those _* is evaluated and executed in entrypoint and it is pretty obscure feature indeed (hence _* convention). Actually there is no need to use it in the docker-compose of ours - we could as easily use commands to run. The main reason it is there is for cases where we want to run the production image standalone and make sure that when you enter the image, the database is initialized - it's mostly for development and testing when sqlite database is used. Since this is a separate command to run in docker compose, I think it would be ok to replace it with direct commands to run in the image. Feel free to change it @mik-laj |
Apache Airflow version: 2.0.0
Kubernetes version (if you are using kubernetes) (use
kubectl version
): NAEnvironment: Local Windows Laptop
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
The text was updated successfully, but these errors were encountered: