Airflow introduction and installation: Airflow Tutorial P1

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 ก.ค. 2024
  • Airflow introduction and installation: Airflow Tutorial P1
    #Airflow #AirflowTutorial #Coder2j
    ========== VIDEO CONTENT 📚 ==========
    Today I am going to introduce Apache Airflow and guide you through how to install airflow locally in your python environment to get a properly running airflow on your local machine. By watching this video, you will know:
    👉 What is Apache Airflow
    👉 Which problems does it try to solve
    👉 How to install it on your local machine
    Check the blog post: coder2j.com/airflow-tutorial/...
    Video Request: forms.gle/UMp4GA3krcSMMWzy9
    ========== L I N K S 🔗 ==========
    Blog Post 👉 bit.ly/3BD8eUx
    Airflow Documentation 👉 bit.ly/3wbTqv4
    ========== T I M E S T A M P ⏰ ==========
    00:00 - Introduction
    00:39 - Create the Airflow project folder
    01:37 - Create a local python environment
    02:50 - Install Airflow and its dependencies via pip
    04:43 - Export Airflow Home and init the DB
    05:18 - Launch the airflow webserver
    05:50 - Create a username and password
    06:59 - Start the airflow scheduler
    ========== Connect with me 👏 ==========
    Twitter 👉 / coder2j
    Website 👉 coder2j.com
    GitHub 👉 github.com/coder2j

ความคิดเห็น • 70

  • @karangupta_DE
    @karangupta_DE 2 ปีที่แล้ว +4

    you are a life saver sir, i was not able to get my airflow scheduler up no matter what, then i followed your tutorial and it's finally running. Also for mac os users, when creating a virtual env, make sure that the python is pointed to the homebrew bin python installation,

    • @coder2j
      @coder2j  2 ปีที่แล้ว

      You are welcome! Glad you get Airflow running finally. 🙌

  • @funnyshortstoday1638
    @funnyshortstoday1638 2 ปีที่แล้ว

    Thank you very very very very much. I was looking everywhere for such an excellent tutorial video but was always getting stuck somewhere. This is gold :)

    • @coder2j
      @coder2j  2 ปีที่แล้ว

      Thank you for your warm comment.

  • @leamonlee8809
    @leamonlee8809 2 ปีที่แล้ว

    Nice tutorial! Thanks for sharing.

  • @guilhermepalazzo1289
    @guilhermepalazzo1289 2 ปีที่แล้ว +1

    simply an amazing tutorial for beginners, congratulations!

    • @coder2j
      @coder2j  2 ปีที่แล้ว +1

      Thanks for your nice comment! 😁

  • @michaellwagner97
    @michaellwagner97 3 ปีที่แล้ว +2

    It's really amazing. Everything is clear und structured. I can easily follow your step to learn and finish my work. Thanks a lot! By the way the design is also very good. : )

    • @coder2j
      @coder2j  3 ปีที่แล้ว +1

      Thanks for your nice comment! I am glad that it helps.

  • @ahanafislam4358
    @ahanafislam4358 2 ปีที่แล้ว +1

    you're such a great teacher. please make more videos about airflow. it will be based if you make a project-based air flow tutorial

    • @coder2j
      @coder2j  2 ปีที่แล้ว +1

      Thanks, there will be more videos coming. Stay tuned!

  • @juliocardenas-rodriguez1986
    @juliocardenas-rodriguez1986 2 ปีที่แล้ว

    Thank you !
    Clear, correct, and short =)

    • @coder2j
      @coder2j  2 ปีที่แล้ว

      Glad you like it.

  • @matheuskempa9425
    @matheuskempa9425 3 ปีที่แล้ว

    Amazing, very well explained.

    • @coder2j
      @coder2j  3 ปีที่แล้ว +1

      Thanks for your comment Matheus. Nice to hear that you like it!

  • @user-vm8yn4hb4w
    @user-vm8yn4hb4w 2 ปีที่แล้ว

    thanku somuch

  • @user-mc9xg2qv8e
    @user-mc9xg2qv8e 8 หลายเดือนก่อน

    thank you so much sir, this vedio was very useful:)

    • @coder2j
      @coder2j  8 หลายเดือนก่อน

      You are welcome 🤗

  • @mohamedmakni2402
    @mohamedmakni2402 3 หลายเดือนก่อน

    worked for me

  • @ludvigstoix709
    @ludvigstoix709 2 ปีที่แล้ว

    Thanks for the video - nice explanations! Would be curious to understand what your opinions are around pros & cons for using Airflow?

    • @coder2j
      @coder2j  2 ปีที่แล้ว +1

      You are welcome! This is a good question, you can read my blog post at here: coder2j.com/apache-airflow/apache-airflow-introduction-and-local-installation-guide/

  • @sandipgupta7745
    @sandipgupta7745 2 ปีที่แล้ว

    Thankyou soo much 💓

    • @coder2j
      @coder2j  2 ปีที่แล้ว

      You are welcome. :-)

  • @satyajitrajbanshi3620
    @satyajitrajbanshi3620 10 หลายเดือนก่อน +2

    How to resolve the module PWD and resource error while trying "airflow webserver - P 8080"?

  • @cheesepieist
    @cheesepieist 2 ปีที่แล้ว

    Hi great video, however i am stuck at installing Airflow @5.59. Modulenotfound error: no module named wtforms.compat. I have installed the constraints properly and am still receiving the error. Please help

  • @saifumar3001
    @saifumar3001 2 ปีที่แล้ว +4

    i get this exception when i run the command " airflow db init" ........ EXCEPTION : File "/c/projects/airflow/setup1/airflow_env/lib/python3.10/site-packages/airflow/www/app.py", line 84, in create_app raise AirflowConfigException(
    airflow.exceptions.AirflowConfigException: Cannot use relative path: `sqlite:///./airflow.db` to connect to sqlite. Please use absolute path such as `sqlite:////tmp/airflow.db`.

    • @coder2j
      @coder2j  2 ปีที่แล้ว +1

      Just go to the airflow.cfg file, update the sql_alchemy_conn = sqlite:///./airflow.db to absolute path.

  • @stephenokon3227
    @stephenokon3227 2 ปีที่แล้ว

    Hello coder2j, can you please do a lesson on copy data from an API and using it in airflow. For instance, copying sales data and weather forecast data into airflow to train a machine to predict sales over a particular season of the year. It could be the sales of umbrella, a certain type of clothing, cream or even ice-cream.

    • @coder2j
      @coder2j  2 ปีที่แล้ว +4

      Wow, thanks for suggesting it. This could be a great ML end-to-end practical courses. Who else want to see this series? Please shout here. :-)

    • @Ilya_4276
      @Ilya_4276 ปีที่แล้ว

      @@coder2j Yes +1

  • @hamzasabri5610
    @hamzasabri5610 หลายเดือนก่อน

    exporting the airflow on my end I had to export it this way for it to work globally
    export AIRFLOW_HOME=~/airflow

  • @spradhan36
    @spradhan36 2 ปีที่แล้ว

    I have couple questions -
    1. How can we change the default DB from sqlite to postgres ? Like execute all the migrations in postgres instead of sqlite.
    2. Can we connect to a local postgres instance from Airflow->Admin->Connections ?

    • @coder2j
      @coder2j  2 ปีที่แล้ว

      Thanks for posting.
      1. You can check the part 2 tutorial which uses postgres db as the backend. You can migrate changes from sqlite into postgres if needed.
      2. Already working on it. Stay tuned!! 🙌

  • @rishabhkaushik2468
    @rishabhkaushik2468 ปีที่แล้ว +1

    Hi, I am getting this error
    The conflict is caused by:
    apache-airflow 2.5.2 depends on python-daemon>=3.0.0
    The user requested (constraint) python-daemon==2.3.2
    To fix this you could try to:
    1. loosen the range of package versions you've specified
    2. remove package versions to allow pip attempt to solve the dependency conflict

    • @coder2j
      @coder2j  ปีที่แล้ว +1

      Thanks for sharing!

  • @universe2dimension
    @universe2dimension 2 ปีที่แล้ว

    请问大哥,你的executor是local 还是remote ? 具体是哪个? 谢谢

    • @coder2j
      @coder2j  2 ปีที่แล้ว +1

      Local executor. 可以查看第二集 docker compose yaml 的设置。th-cam.com/video/J6azvFhndLg/w-d-xo.html

  • @user-bf7eg3rf5d
    @user-bf7eg3rf5d 7 หลายเดือนก่อน

    Nice Tutorial. But i m trying to install airflow in my windows machine. But when i tried to start to webserver its prompting me like there is no 'pwd' module to start the webserver. Could you please explain or provide any reference on how to start airflow webserver in windows boxes.

    • @coder2j
      @coder2j  7 หลายเดือนก่อน

      On Windows you have to use Windows Subsystem Linux to install Airflow.

  • @varunkp9717
    @varunkp9717 ปีที่แล้ว

    iam facin this error when i tried to type "python3 --version"
    *Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.*
    can you help me in this?

    • @coder2j
      @coder2j  ปีที่แล้ว

      Make sure when you install python, check add python into path button.

  • @joshuadanielmendoza6124
    @joshuadanielmendoza6124 หลายเดือนก่อน

    why is that airflow.cfg is not in my current directory?

    • @coder2j
      @coder2j  หลายเดือนก่อน

      Because you are not setting the AIRFLOW_HOME environment variable right. You need to set it to your current absolute directory.

  • @salimmzoughi3474
    @salimmzoughi3474 ปีที่แล้ว

    Thank you for the course ..
    Trying to run it locally, but I'm getting this error message "{webserver_command.py:252} ERROR - [0 / 0] Some workers seem to have died and gunicorn did not restart them as expected" => Please let me know how to bypass this .. thanks

    • @coder2j
      @coder2j  ปีที่แล้ว

      Which OS platform and airflow version? When do you get this error?

    • @aperez1969
      @aperez1969 ปีที่แล้ว

      same issue here!

  • @syedmujeeb2442
    @syedmujeeb2442 2 ปีที่แล้ว

    when I run airflow scheduler, it throws OSError: [Errno 48] Address already in use

    • @coder2j
      @coder2j  2 ปีที่แล้ว

      It might be that your 8080 port is being used by other process. Stop it and try again.

    • @syedmujeeb2442
      @syedmujeeb2442 2 ปีที่แล้ว

      @@coder2j I'm getting this error frequently
      Please advise
      The scheduler does not appear to be running. The last heartbeat was received 25 minutes ago.
      The DAGs list may not update, and new tasks will not be scheduled.

  • @jorgeguberte
    @jorgeguberte 3 หลายเดือนก่อน

    Mine installed without the examples

  • @jaym7178
    @jaym7178 2 ปีที่แล้ว

    Is this series for airflow enough for me to understand fundamental

    • @coder2j
      @coder2j  2 ปีที่แล้ว

      Yes, it is beginners guide. You will get started fast and learn the essential fundamentals.

    • @jaym7178
      @jaym7178 2 ปีที่แล้ว

      Many thanks I am at a beginner stage what is the skills required to be a junior data engineer
      I am learning the following python sql fundamental of data warehouse course I found udemy and apache spark will that be sufficient for me to secure a junior position
      In addition do three projects

    • @coder2j
      @coder2j  2 ปีที่แล้ว

      In my opinion, junior data engineer need to have the Python coding skills, know how to manipulate data with various sources like SQL server, MySQL, PostgreSQL, ETL platform like Airflow, cloud services experience like AWS, Google Cloud or Azure, and basic software engineering knowledge like how to write clean code, unit test, CI/CD Pipeline. Familiar with Apache Spark, docker would be a plus.

    • @jaym7178
      @jaym7178 2 ปีที่แล้ว

      @@coder2j I spoke to several data engineer I was told python,sql and data warehouse is sufficient for junior role as for Cloud, airflow and apache spark is based on company which tool they use I will learn airflow and basic spark using python api
      Thanks

  • @nicholascunha1176
    @nicholascunha1176 10 หลายเดือนก่อน

    Someone had:
    ModuleNotFoundError: No module named 'pwd'
    after airflow webserver -p 8080?

    • @satyajitrajbanshi3620
      @satyajitrajbanshi3620 10 หลายเดือนก่อน

      Yeah I'm getting module PWD and resource error 😢.. Please let me know if you resolve the issue

    • @coder2j
      @coder2j  10 หลายเดือนก่อน +1

      Airflow is not supported natively on windows. If you are running it on windows, you have to run it on the windows linux subsystem or with docker.

  • @vaibhavverma1340
    @vaibhavverma1340 ปีที่แล้ว

    IT Gives me error :-
    PS D:\Airflow> source py_env/bin/activate
    source : The term 'source' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
    included, verify that the path is correct and try again.
    At line:1 char:1
    + source py_env/bin/activate
    + ~~~~~~
    + CategoryInfo : ObjectNotFound: (source:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

    • @coder2j
      @coder2j  ปีที่แล้ว

      Airflow is not supported natively on windows. You can try it on wsl.

  • @girisuryamawandi7902
    @girisuryamawandi7902 11 หลายเดือนก่อน

    can help me ?
    i got this when instaling airflow db init
    "WARNI [airflow.models.crypto] empty cryptography key - values will not be stored encrypted."
    the new folder log, airflow.cfg and airflow.db not creating and I use wsl 2 in windows 10

    • @coder2j
      @coder2j  11 หลายเดือนก่อน +1

      Make sure you have environmental variable `AIRFLOW_HOME` to the proper directory, otherwise it will be default to your home directory.

    • @girisuryamawandi7902
      @girisuryamawandi7902 11 หลายเดือนก่อน

      @@coder2j i type 'export AIRFLOW_HOME = /' before install apache airflow then airflow db init. can you tell me how to see if AIRFLOW_HOME is in right directory ?
      ah the same warning but folder log, airflow.cfg and airflow.db is created
      Thanks

  • @Wozywors-sq8bw
    @Wozywors-sq8bw ปีที่แล้ว

    a me i comandi "airflow db init" e "airflow webserver -p 8080" non vanno quando mi trovo in py_env, mi sai dire perchè? quando lancio "ariflow webserver -p 8080" mi escono questi output:
    Traceback (most recent call last):
    File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
    File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
    File "/home/amb/.local/lib/python3.10/site-packages/gunicorn/__main__.py", line 7, in
    run()
    File "/home/amb/.local/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 67, in run
    WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
    File "/home/amb/.local/lib/python3.10/site-packages/gunicorn/app/base.py", line 231, in run
    super().run()
    File "/home/amb/.local/lib/python3.10/site-packages/gunicorn/app/base.py", line 72, in run
    Arbiter(self).run()
    File "/home/amb/.local/lib/python3.10/site-packages/gunicorn/arbiter.py", line 58, in __init__
    self.setup(app)
    File "/home/amb/.local/lib/python3.10/site-packages/gunicorn/arbiter.py", line 118, in setup
    self.app.wsgi()
    File "/home/amb/.local/lib/python3.10/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
    File "/home/amb/.local/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
    return self.load_wsgiapp()
    File "/home/amb/.local/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
    return util.import_app(self.app_uri)
    File "/home/amb/.local/lib/python3.10/site-packages/gunicorn/util.py", line 412, in import_app
    app = app(*args, **kwargs)
    File "/home/amb/.local/lib/python3.10/site-packages/airflow/www/app.py", line 181, in cached_app
    app = create_app(config=config, testing=testing)
    File "/home/amb/.local/lib/python3.10/site-packages/airflow/www/app.py", line 99, in create_app
    raise AirflowConfigException(
    airflow.exceptions.AirflowConfigException: Cannot use relative path: `sqlite:///./airflow.db` to connect to sqlite. Please use absolute path such as `sqlite:////tmp/airflow.db`.

    • @coder2j
      @coder2j  ปีที่แล้ว

      Go to your config file, change the SQLite path to an absolute path.

    • @Wozywors-sq8bw
      @Wozywors-sq8bw ปีที่แล้ว

      @@coder2j il problema sembra essere il comando export AIRFLOW_HOME=., nel momento in cui lancio il comando AIRFLOW_HOME=~/airflow tutto ritorna a funzionare ma non credo sia la soluzione giusta