inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

Airflow 마스터 클래스

Airflow library 설치

맥으로 에어플로우 라이브러리 설치가 안됩니다.

1331

이상윤

작성한 질문수 1

0

1 error generated.

error: command '/usr/bin/gcc' failed with exit code 1

[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

ERROR: Failed building wheel for google-re2

Failed to build google-re2

ERROR: Could not build wheels for google-re2, which is required to install pyproject.toml-based projects

이렇게 뜨는데 뭐가 문젤까요 검색해도 해결방법이 안뜨네요.

python 데이터-엔지니어링 airflow

답변 1

0

김현진

안녕하세요 이상윤님!

혹시 airflow 몇 버전 설치하셨나요?

그리고 현재 MAC에 설치된 파이썬 버전도 확인 부탁드립니다.

0

권소영

안녕하세요 강사님!

제가 올린 글은 아니지만 저도 비슷한 오류(error: command '/usr/bin/gcc' failed with exit code 1) 를 겪었는데요!

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

위 버전으로 설치하였고 mac 파이썬 버전은 3.8.10입니다.

 

에러 전체 공유드립니다!

ERROR: Command errored out with exit status 1:

command: /Users/so0ee/vscode/airflow/venv/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/p7/h6r0gcsn71x3mg8wbckmy5ym0000gn/T/pip-install-2j892vnl/google-re2_97d611f11a3e4cb4b62c80de0283de98/setup.py'"'"'; file='"'"'/private/var/folders/p7/h6r0gcsn71x3mg8wbckmy5ym0000gn/T/pip-install-2j892vnl/google-re2_97d611f11a3e4cb4b62c80de0283de98/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/p7/h6r0gcsn71x3mg8wbckmy5ym0000gn/T/pip-record-_hu0rca0/install-record.txt --single-version-externally-managed --compile --install-headers /Users/so0ee/vscode/airflow/venv/include/site/python3.8/google-re2

cwd: /private/var/folders/p7/h6r0gcsn71x3mg8wbckmy5ym0000gn/T/pip-install-2j892vnl/google-re2_97d611f11a3e4cb4b62c80de0283de98/

Complete output (28 lines):

running install

/Users/so0ee/vscode/airflow/venv/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.

!!

********************************************************************************

Please avoid running ``setup.py`` directly.

Instead, use pypa/build, pypa/installer or other

standards-based tools.

See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.

********************************************************************************

!!

self.initialize_options()

running build

running build_py

creating build

creating build/lib.macosx-10.9-x86_64-cpython-38

copying re2.py -> build/lib.macosx-10.9-x86_64-cpython-38

running build_ext

building '_re2' extension

creating build/temp.macosx-10.9-x86_64-cpython-38

gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Users/so0ee/vscode/airflow/venv/include -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c re2.cc -o build/temp.macosx-10.9-x8664-cpython-38/_re2.o -fvisibility=hidden

_re2.cc:11:10: fatal error: 'pybind11/pybind11.h' file not found

#include <pybind11/pybind11.h>

^~~~~~~~~~~~~~~~~~~~~

1 error generated.

error: command '/usr/bin/gcc' failed with exit code 1

----------------------------------------

ERROR: Command errored out with exit status 1: /Users/so0ee/vscode/airflow/venv/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/p7/h6r0gcsn71x3mg8wbckmy5ym0000gn/T/pip-install-2j892vnl/google-re2_97d611f11a3e4cb4b62c80de0283de98/setup.py'"'"'; file='"'"'/private/var/folders/p7/h6r0gcsn71x3mg8wbckmy5ym0000gn/T/pip-install-2j892vnl/google-re2_97d611f11a3e4cb4b62c80de0283de98/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/p7/h6r0gcsn71x3mg8wbckmy5ym0000gn/T/pip-record-_hu0rca0/install-record.txt --single-version-externally-managed --compile --install-headers /Users/so0ee/vscode/airflow/venv/include/site/python3.8/google-re2 Check the logs for full command output.

1

김현진

안녕하세요 권소영님

위에 질문주신 이상윤님하고는 조금 다른 문제인것 같긴한데,

MAC에서 아래 명령으로 pybind11 설치해보시겠어요?

pip install pybind11 

설치 후 재시도 해보시고, 안되면 에러 로그 추가 부탁드려요.

마침 저도 맥북 주문 후 대기중인데 한번 해보고 추가 결과 남겨드릴꼐요 ^^

 

0

권소영

안녕하세요!

말씀주신대로 해본 후 재설치 했는데 여전히 에러가 나네요 ㅠㅠ

setup.py가 문제인 것 같기도 합니다 ㅠㅠ

 

Running setup.py install for google-re2 ... error

ERROR: Command errored out with exit status 1:

command: /Users/so0ee/vscode/airflow/venv/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/p7/h6r0gcsn71x3mg8wbckmy5ym0000gn/T/pip-install-dy3e18h8/google-re2_384c3de5615a43e5a9009f74529513e2/setup.py'"'"'; file='"'"'/private/var/folders/p7/h6r0gcsn71x3mg8wbckmy5ym0000gn/T/pip-install-dy3e18h8/google-re2_384c3de5615a43e5a9009f74529513e2/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/p7/h6r0gcsn71x3mg8wbckmy5ym0000gn/T/pip-record-oo6pupmb/install-record.txt --single-version-externally-managed --compile --install-headers /Users/so0ee/vscode/airflow/venv/include/site/python3.8/google-re2

cwd: /private/var/folders/p7/h6r0gcsn71x3mg8wbckmy5ym0000gn/T/pip-install-dy3e18h8/google-re2_384c3de5615a43e5a9009f74529513e2/

Complete output (190 lines):

running install

/Users/so0ee/vscode/airflow/venv/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.

!!

********************************************************************************

Please avoid running ``setup.py`` directly.

Instead, use pypa/build, pypa/installer or other

standards-based tools.

See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.

********************************************************************************

 

1

김현진

안녕하세요 권소영님

여러가지로 확인해본 결과 Mac에 airflow 설치할 때 google-re2 라이브러리에서 문제가 있는듯 합니다.

해당 라이브러리는 구글에서 개발한 정규표현식 라이브러리로 나오는데, airflow 2.6.3에서 도입된걸로 확인됩니다.

일단 2.6.2 버전으로 설치해보시겠어요?

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

이걸로 설치가 잘 되면, docker-compose.yaml 로 설치할 때에도 동일하게 2.6.2 버전으로 받으시면 됩니다.

curl -LfO 'https://airflow.apache.org/docs/apache-airflow/2.6.2/docker-compose.yaml'

 

0

권소영

안녕하세요 강사님!

말씀해주신 버전으로 시도해봤는데도 같은 오류가 뜨네요 ㅠㅠ

 

혹시 몰라 2.6.1로도 시도해봤는데

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

이번에는

RROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.

opentelemetry-api 1.23.0 requires importlib-metadata<7.0,>=6.0, but you have importlib-metadata 4.13.0 which is incompatible.

요런 에러가 뜨네요!

2

김현진

일단 google-re2 에러는 없어지긴 했네요.

이번에 뜬 에러는 importlib-metadata 라이브러리 6.0 이상이 필요한데 지금 설치되어 있는 라이브러리 버전이 4.13.0 라서 뜬 에러입니다.

파이썬은 이런 경우가 다반사라서 가상환경을 만들어두고 작업해야 합니다.

혹시 pip install 시도했을 때 가상환경이 아니었다면 가상환경을 하나 만들고 그 안에서 한번 해보면 될 듯 합니다.

 

python -m venv airflow_venv 

와 같이 명령하면 airflow_venv 디렉토리가 하나 생깁니다.

그리고 아래 명령으로 가상환경 안으로 진입할 수 있어요.

source ./bin/activate 

그 다음 아래 명령으로 다시 설치 시도해보심 되겠습니다.

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

해보시고 결과 알려주세요 ^^

 

0

권소영

안녕하세요 강사님!

우선 말씀주신 방향으로하니 해결 되었습니다!

 

이전에도 강의에서 말씀주신대로 vscode를 통해 가성환경안에 들어가서 설치했었는데요!

그때는 안됐었는데 이번에는 답변주신대로 source 명령어를 통해 가상환경에 들어갔더니 설치가 되었습니다.

 

이 두 방법에 차이가 있나요?? 해결되긴 하였으나 궁금해서 여쭤봅니다!!

최근 회사 업무가 바빠져서 확인이 늦었네요 ㅠㅠ

늦은 시간까지 계속해서 알아봐주시고 답변주셔서 감사합니다 ㅠㅠ

1

김현진

해걀되었다니 다행이네요^^

 

그리고 질문주신 내용은 예전에는 동일한 맥북+vscode+가상환경 들어가서 시도했을때는 안됐고

맥북+source 명령어로 들어가서 시도했을때는 잘 됐다는 의미이지요?

원래는 vscode에서 가상환경 진입 후 시도해도 잘 되어야합니다. 혹시 그때 뜬 에러는 google-re2 모듈관련해서 뜬 에러 아니었을까요? 현재까지 보면 google-re2 에러는 가상환경의 문제는 아니고 맥북환경에서 문제가 있는 듯 합니다. 혹시 그때 떴던 에러 캡처해서 올려주실수 있으면 한번 볼께요 ^^

pykrx 회원제 전환으로 인한 실습 불가

0

109

2

수료증 발급

0

81

3

에러 발생 관련 질문드립니다.

0

80

2

vscode 작업화면에 오류가 발생하지 않습니다.

0

69

2

plugins 폴더 생성

0

74

2

WSL에서 git push 가 안되요 ㅠ

0

112

2

chatGPT&Airflow로 블로그 자동 포스팅하기 는 Deprecated 가 필요합니다.

0

66

2

github에 회원가입이 안되는데 원인이 뭔지 모르겠어요 ㅠ

0

721

2

설치중인데 venv를 꼭 써야할까요?

0

124

2

설치 버전 관련 질문입니다.

0

68

1

우분투 버전 다운받아야하는데 어떤걸로 설치해야할까요?

0

62

1

DAG 만들기 중 airflow 패키지 로드 에러

0

106

2

3.0에서도 수업노트가 성립하는지 확인 부탁드립니다!

0

95

3

task_id 사용법이 뭔가 바뀐 것 같습니다.

0

76

3

email operator 오류 관련

0

66

2

plugins 폴더 관련

0

95

2

bash operator 관련 문의입니다

0

78

3

스케쥴러 - DAG 파싱 부하 줄이는 과정 질문

0

79

2

Dags refresh 주기 관련 질문

0

123

2

wsl 관련 질문입니다.!

0

73

2

macOS에서 docker 설치

0

93

2

템플릿 변수에 대한 오류

0

61

2

custom_image 디렉토리 문의드립니다.

0

54

2

ETL 인터뷰 관련 문의

0

102

2