pratik-m commented on PR #43082:
URL: https://github.com/apache/airflow/pull/43082#issuecomment-2443349760
Hi @kaxil - I'm trying to run tests locally (without breeze) and I'm running
into the error `ModuleNotFoundError: No module named 'airflow.providers'`. I
couldn't find references to this issue..do I need to do any further setup to
resolve this issue?
**stacktrace**
```
(airflow-312)
pratik@pratik-Inspiron-16-7630-2-in-1:~/personal/projects/airflow$ pytest
tests/utils/test_db_cleanup.py
================================================= test session starts
==================================================
platform linux -- Python 3.12.7, pytest-8.3.3, pluggy-1.5.0 --
/home/pratik/.local/share/hatch/env/virtual/apache-airflow/lGCtOum7/airflow-312/bin/python
cachedir: .pytest_cache
rootdir: /home/pratik/personal/projects/airflow
configfile: pyproject.toml
plugins: requests-mock-1.12.1, anyio-4.4.0, custom-exit-code-0.3.0,
instafail-0.5.0, mock-3.14.0, asyncio-0.24.0, timeouts-1.2.1, cov-5.0.0,
xdist-3.6.1, rerunfailures-14.0, time-machine-2.15.0, icdiff-0.9
asyncio: mode=Mode.STRICT, default_loop_scope=function
setup timeout: 0.0s, execution timeout: 0.0s, teardown timeout: 0.0s
collected 0 items / 1 error
======================================================== ERRORS
========================================================
___________________________________ ERROR collecting
tests/utils/test_db_cleanup.py ____________________________________
ImportError while importing test module
'/home/pratik/personal/projects/airflow/tests/utils/test_db_cleanup.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../.local/share/hatch/env/virtual/apache-airflow/lGCtOum7/airflow-312/lib/python3.12/site-packages/_pytest/python.py:493:
in importtestmodule
mod = import_path(
../../../.local/share/hatch/env/virtual/apache-airflow/lGCtOum7/airflow-312/lib/python3.12/site-packages/_pytest/pathlib.py:582:
in import_path
importlib.import_module(module_name)
/usr/lib/python3.12/importlib/__init__.py:90: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1387: in _gcd_import
???
<frozen importlib._bootstrap>:1360: in _find_and_load
???
<frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:935: in _load_unlocked
???
../../../.local/share/hatch/env/virtual/apache-airflow/lGCtOum7/airflow-312/lib/python3.12/site-packages/_pytest/assertion/rewrite.py:184:
in exec_module
exec(co, module.__dict__)
tests/utils/test_db_cleanup.py:34: in <module>
from airflow.models import DagModel, DagRun, TaskInstance
airflow/models/__init__.py:78: in __getattr__
val = import_string(f"{path}.{name}")
airflow/utils/module_loading.py:39: in import_string
module = import_module(module_path)
/usr/lib/python3.12/importlib/__init__.py:90: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
airflow/models/dag.py:95: in <module>
from airflow.models.abstractoperator import AbstractOperator,
TaskStateChangeCallback
airflow/models/abstractoperator.py:33: in <module>
from airflow.template.templater import Templater
airflow/template/templater.py:23: in <module>
from airflow.io.path import ObjectStoragePath
airflow/io/__init__.py:30: in <module>
from airflow.providers_manager import ProvidersManager
airflow/providers_manager.py:39: in <module>
from airflow.providers.standard.hooks.filesystem import FSHook
E ModuleNotFoundError: No module named 'airflow.providers'
=============================================== short test summary info
================================================
ERROR tests/utils/test_db_cleanup.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during
collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================= 1 warning, 1 error in 0.83s
==============================================
(airflow-312)
pratik@pratik-Inspiron-16-7630-2-in-1:~/personal/projects/airflow$
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]