jolly-florist-66728
09/25/2024, 9:56 AMjolly-florist-66728
09/25/2024, 9:56 AM>>``` in <module>:13 ││ │ │ ❱ 13 @task(container_image=boto3_image_spec) │ │ │ │ /Users/virtual_environments/.venv/lib/python3.11/site-packages/flyt │ │ ekit/core/task.py:328 in wrapper │ │ │ │ ❱ 328 │ │ task_instance = TaskPlugins.find_pythontask_plugin(type(task_config))( │ │ │ │ /Users/virtual_environments/.venv/lib/python3.11/site-packages/flyt │ │ ekit/core/tracker.py:85 in call │ │ │ │ ❱ 85 │ │ o = super(InstanceTrackingMeta, cls).__call__(*args, **kwargs) │ │ │ │ /Users/virtual_environments/.venv/lib/python3.11/site-packages/flyt │ │ ekit/core/python_function_task.py:134 in init │ │ │ │ ❱ 134 │ │ name, _, _, _ = extract_task_module(task_function) │ │ │ │ /Users/virtual_environments/.venv/lib/python3.11/site-packages/flyt │ │ ekit/core/tracker.py:336 in extract_task_module │ │ │ │ ❱ 336 │ │ mod_name = get_full_module_path(f, file_name) # type: ignore │ │ │ │ /Users/virtual_environments/.venv/lib/python3.11/site-packages/flyt │ │ ekit/core/tracker.py:348 in get_full_module_path │ │ │ ```
jolly-florist-66728
09/25/2024, 9:56 AM>>```│ ❱ 348 │ │ new_mod_name = _mod_sanitizer.get_absolute_module_name(inspect.getabsfile(mod), ││ │ │ /Users/virtual_environments/.venv/lib/python3.11/site-packages/flyt │ │ ekit/core/tracker.py:295 in get_absolute_module_name │ │ │ │ ❱ 295 │ │ return self._resolve_abs_module_name(path, package_root) │ │ │ │ /Users/virtual_environments/.venv/lib/python3.11/site-packages/flyt │ │ ekit/core/tracker.py:281 in _resolve_abs_module_name │ │ │ │ ❱ 281 │ │ if "__init__.py" not in os.listdir(dirname): │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/sn/cfpmtf0555dgbd6lv9ljn1yh0000gp/T/ipykernel_51609'```
jolly-florist-66728
09/25/2024, 9:56 AM>># Answer The error you're encountering is related to changes in how Flytekit handles module resolution and task registration in versions 1.12.0 and higher. This issue is likely due to the way Flytekit tries to determine the module path for the task, which can be problematic in environments like Jupyter notebooks. According to this GitHub issue, Flytekit versions after 1.11.0 handle module names differently, which might be causing the
FileNotFoundError. The error occurs because Flytekit is trying to access a directory that doesn't exist in the Jupyter notebook environment.
Would you like more detailed steps or further assistance?
Sources:
- https://github.com/flyteorg/flyte/issues/5706
Slack Link
https://.slack.com/archives/CP2HDHKE1/p1727258193.869419 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.