I have been trying to install Apache Airflow on my local Mac machine for weeks. No tutorial have been helpful, I’ve been literally reading the Airflow website docs through and through, copying step by step processes, used Claude and ChatGPT but I don’t seem to get it running.
When I run any airflow commands such as airflow standalone
or airflow db init
, I get the following error:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/airflow/settings.py", line 55, in <module>
TIMEZONE = pendulum.tz.timezone(tz)
^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'module' object is not callable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.12/bin/airflow", line 5, in <module>
from airflow.__main__ import main
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/airflow/__init__.py", line 52, in <module>
from airflow import configuration, settings
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/airflow/configuration.py", line 2340, in <module>
secrets_backend_list = initialize_secrets_backends()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/airflow/configuration.py", line 2254, in initialize_secrets_backends
secrets_backend_cls = import_string(class_name)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/airflow/utils/module_loading.py", line 37, in import_string
module = import_module(module_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/airflow/secrets/metastore.py", line 29, in <module>
from airflow.utils.session import NEW_SESSION, provide_session
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/airflow/utils/session.py", line 24, in <module>
from airflow import settings
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/airflow/settings.py", line 57, in <module>
TIMEZONE = pendulum.tz.timezone("UTC")
^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'module' object is not callable
I have created a python environment using python -m venv venv
command and installed the following dependencies:
AIRFLOW_VERSION=2.10.0
# Extract the version of Python you have installed. If you're currently using a Python version that is not supported by Airflow, you may want to set this manually.
# See above for supported versions.
PYTHON_VERSION="$(python -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')"
CONSTRAINT_URL="https://raw.githubusercontent.com/apache/airflow/constraints-${AIRFLOW_VERSION}/constraints-${PYTHON_VERSION}.txt"
# For example this would install 2.10.0 with python 3.8: https://raw.githubusercontent.com/apache/airflow/constraints-2.10.0/constraints-3.8.txt
pip install "apache-airflow==${AIRFLOW_VERSION}" --constraint "${CONSTRAINT_URL}"
I’ve changed it to my Python version 12.0 (which is compatible with Airflow.
I’ve also tried to install pendulum package as it seems like what it’s needed but it’s still giving the same error output.
Please help, I beg you, I’ve been struggling immensively with this. I really need to get an Airflow application running and it’s just looking impossible.
2