Hey guys!! I've got a question we've been trying t...
# flyte-support
b
Hey guys!! I've got a question we've been trying to solve for a while. We're packaging a module containing a workflow like this:
pyflyte --pkgs my_workflows package -f
Everything works fine, then we register it:
flytectl register files \
--project $PROJECT \
--domain $DOMAIN \
--archive $ARCHIVE \
--version "$VERSION"
and when we run it we see the following error:
Copy code
Trace:

    Traceback (most recent call last):
      File "/usr/local/lib/python3.12/site-packages/flytekit/bin/entrypoint.py", line 182, in _dispatch_execute
        task_def = load_task()
                   ^^^^^^^^^^^
      File "/usr/local/lib/python3.12/site-packages/flytekit/bin/entrypoint.py", line 604, in load_task
        return resolver_obj.load_task(loader_args=resolver_args)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.12/site-packages/flytekit/core/utils.py", line 309, in wrapper
        return func(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.12/site-packages/flytekit/core/python_auto_container.py", line 302, in load_task
        task_module = importlib.import_module(name=task_module)  # type: ignore
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
      File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
      File "<frozen importlib._bootstrap>", line 1324, in _find_and_load_unlocked
    ModuleNotFoundError: No module named 'my_workflows'

Message:

    ModuleNotFoundError: No module named 'my_workflows'
e
Are you using absolute imports of the tasks in the workflow definition? What do the imports look like? (could you also share your dir structure?)