본문 바로가기

개발중/AirFlow

[AirFlow] ContentType Mysql 누락

728x90
반응형

 

MySQL Content Type 을 선택하고 싶은데 주어진 값에 "MySQL" 은 없습니다.

 

 

 

 

MySQL을 사용하려면, MySQL과 연동하는 Airflow Provider 패키지를 설치해야 합니다. 해당 패키지가 설치되지 않으면 MySQL 연결 타입이 Airflow의 UI에서 누락될 수 있다고 합니다.

 

 

Mysql 옵션을 다운로드 하자.

pip install apache-airflow-providers-mysql

 

근데 이런 에러가 난다면

× Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [27 lines of output]
      /bin/sh: 1: pkg-config: not found
      /bin/sh: 1: pkg-config: not found
      /bin/sh: 1: pkg-config: not found
      Trying pkg-config --exists mysqlclient
      Command 'pkg-config --exists mysqlclient' returned non-zero exit status 127.
      Trying pkg-config --exists mariadb
      Command 'pkg-config --exists mariadb' returned non-zero exit status 127.
      Trying pkg-config --exists libmariadb
      Command 'pkg-config --exists libmariadb' returned non-zero exit status 127.
      Traceback (most recent call last):
        File "/usr/local/lib/python3.8/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/usr/local/lib/python3.8/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/usr/local/lib/python3.8/dist-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-jfakjpcd/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 332, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
        File "/tmp/pip-build-env-jfakjpcd/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 302, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-jfakjpcd/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 318, in run_setup
          exec(code, locals())
        File "<string>", line 155, in <module>
        File "<string>", line 49, in get_config_posix
        File "<string>", line 28, in find_package_name
      Exception: Can not find valid pkg-config name.
      Specify MYSQLCLIENT_CFLAGS and MYSQLCLIENT_LDFLAGS env vars manually
      [end of output]

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

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

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

 

 

아래와 같이 pkg-config 를 다운로드 받고 다시 시도해보자.

sudo apt-get update
sudo apt-get install -y pkg-config libmysqlclient-dev build-essential

 

 

잘 다운로드 되는 것을 확인 할 수 있다.

 

AirFlow 기동하면 MySQL 옵션이 생긴걸 확인할 수 있다.

 

728x90
반응형