-
Notifications
You must be signed in to change notification settings - Fork 14.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: 'module' object is not callable #36524
Comments
Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval. |
Airfow Does not work on Python 3.12 (see prerequisites). One of the reason is migration to Pendulum 3 which is in progress #36281 - if you want to help with that by reviews and testing of that PR, you are most welcome. |
Usually I get an error when installing if requirements are not satisfied (e.g python 3.12 is not supported). |
Yes. It works if you have crystal ball and can foresee that future versions of things will not get supported. 2.7.2 was released around the time Python 3..12 and (as you might read in release notes) 2.7.3 was already released with < 3.12 limit - this is why you likely got 2.7.2 installed. https://airflow.apache.org/docs/apache-airflow/stable/release_notes.html#airflow-2-7-2-2023-10-12 Usually it's a good idea to read the documentation when you install software. You would have also learned that you should use constraints to install airflow in reproducible way - https://airflow.apache.org/docs/apache-airflow/stable/installation/installing-from-pypi.html and you would have found that there are no constraints for 3.12 for any Airflow version (including 2.7.2) - which is a very clear indication that it is not supported. |
I appreciate your feedback. |
Of course it was not. That's exactly why we explain and recommend our users that they should use constraints. Many of the issues caused by incompatible dependencies produce non-obvious errors and following our recommendations on how you should install Airflow is a good way to avoid those kind of problems - which are inherently impossible to prevent in Python ecosystem when your application has 650+ dependencies. We even did not stop at the documentation and went ahead and explained more details why it is like that and why you should use constraints in a few talks. This is the one I gave at Airflow Summit, explaining some whys: https://airflowsummit.org/sessions/2023/mastering-dependencies-the-airflow-way/ |
Thank you for bringing this to my attention. I anticipate that there may be some challenges ahead, but nonetheless, I truly appreciate the time and effort invested in this project. It's unique and comprehensive in many ways. I look forward to working together to make it even better. |
Apache Airflow version
Other Airflow 2 version (please specify below)
If "Other Airflow 2 version" selected, which one?
2.7.2
What happened?
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/airflow/settings.py", line 55, in
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
from airflow.main import main
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/airflow/init.py", line 52, in
from airflow import configuration, settings
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/airflow/configuration.py", line 2340, in
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
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
from airflow import settings
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/airflow/settings.py", line 57, in
TIMEZONE = pendulum.tz.timezone("UTC")
^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'module' object is not callable
What you think should happen instead?
No response
How to reproduce
~ % airflow webserver -p 8080
Operating System
macOS-14.2.1-arm64-arm-64bit
Versions of Apache Airflow Providers
apache-airflow-providers-common-sql==1.10.0
apache-airflow-providers-ftp==3.7.0
apache-airflow-providers-http==4.8.0
apache-airflow-providers-imap==3.5.0
apache-airflow-providers-sqlite==3.7.0
Deployment
Virtualenv installation
Deployment details
Local installation with python 3.12.1
Anything else?
No response
Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: