[Airflow] Airflow 3.0.4 설치 방법

hugingstar·2025년 11월 29일

DevOps

목록 보기
9/14
post-thumbnail

이번 글에서는 에어플로우를 설치하는 방법을 정리한다. Airflow를 설치하면서 constraint 파일을 설정해주는 곳에서 시간이 필요한데, 파이썬 3.9 버전 가상환경을 사용할 때 Airflow 3.0.4 버전을 많이 사용하는 것 같아서 파이썬 3.9 기준으로 설명한다.

1. 파이썬 3.9 가상환경 생성

  • 개발하고 싶은 프로젝트에서 파이썬 가상환경을 실행시킨다.

  • 파이썬 Scripts 폴더로 들어가서 가상환경을 실행시키는 방법도 있을 것이다.

    activate

  • VS code 터미널창을 열고 인터프리터 설정을 해주고 cmd에서 가상환경을 바라보도록 설정해도된다.

2. Airflow 버전과 constraint 확인

  • 먼저 파이참 인터프리터에서 단순하게 Airflow를 pip 하면 낮은사양에 기능이 별로 없는 상태로 개발해야한다고 한다. (도커를 사용해서 airflow 설치하는 이유)
  • 아래 설치 홈페이지 들어가면 최신 버전은 3.1.3 버전인데 설치할려고 보니까 에러가 발생했다. 정확한 원인은 모르지만, 나한테 맞는 조건에서 깔기 위해서 Constraint 파일을 좀 확인해봤다.

https://airflow.apache.org/docs/apache-airflow/stable/installation/installing-from-pypi.html

  • 파이썬 3.9에서는 Airflow 3.0.4 버전을 사용하고, Constraint 파일을 3.9로 설정하면되는 것같다.

pip install "apache-airflow[celery]==3.0.4" --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-3.0.4/constraints-3
.9.txt"

  • 비교용으로 파이썬 3.7에서는 Airflow 2.5.2 버전을 사용하고, Constraint 파일을 3.7로 설정하면되는 것 같다.

pip install "apache-airflow[celery]==2.5.2" --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-3.0.4/constraints-3
.7.txt"

  • Airflow 3.1.3 버전도 다운 받을 수 있다. 파이썬 버전 확인해야 한다.

pip install "apache-airflow[celery]==3.1.3" --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-3.1.3/constraints-3.12.txt"

0개의 댓글