seunggs
03/16/2023, 5:33 PMpyflyte package
to work without causing module import issues - any help would be greatly appreciated. The project is in /project
(root dir) and inside is /wf
dir with wf_10.py
where the workflow code lives, where I import tasks from main.py
in the same dir. I’m running pyflyte from /project
dir with this command pyflyte --pkgs wf packages ...
and the packaging fails with:
Loading packages ['wf'] under source root /project
Failed with Unknown Exception <class 'ModuleNotFoundError'> Reason: No module named 'main'
No module named 'main'
Kevin Su
03/16/2023, 6:26 PM__init__.py
in /project
?seunggs
03/16/2023, 6:26 PMproject
Kevin Su
03/16/2023, 6:27 PMseunggs
03/16/2023, 6:28 PM/project
directly and run pyflyte package
from there? What should I put as --pkgs
option value?Kevin Su
03/16/2023, 6:32 PMseunggs
03/16/2023, 6:33 PM__init__.py
to /project
folder but same error:Loading packages ['wf'] under source root /project
No module named 'main'
Failed with Unknown Exception <class 'ModuleNotFoundError'> Reason: No module named 'main'
--pkgs
expect absolute path to the package? I assume you can specify relative path from cwd no?Kevin Su
03/16/2023, 6:43 PMseunggs
03/16/2023, 6:44 PM--pkgs .
for running wf_10.py
from project root (where I ran pyflyte
command), but that doesn’t work. --pkgs ''
doesn’t work either__init__.py
in the /project
and then running pyflyte --pkgs wf package ...
there with the code inside /wf
didn’t work eitherKevin Su
03/16/2023, 6:56 PMseunggs
03/16/2023, 7:09 PMpyflyte --pkgs wf package …
?main.py
in my workflow file wf.py
- and the error is main
module does not existfrom main import task1
in wf.py
is not working because pyflyte
was run in /project
- so I think it’s expecting my from main
to be from wf.main
, but I’d like to just use main
as the modulewf.py
is the problem I’m having--pkgs
sets the path in PYTHON_PATH, but it doesn’t seem to?Kevin Su
03/16/2023, 8:40 PM--source ./project/wf
in the command,seunggs
03/16/2023, 8:58 PM/project
, I tried pyflyte --pkgs wf package --source ./wf
and using it now gives an error No module named 'wf'
instead of No module named 'main'
- so it looks like --source
sets the project folder, but by doing that, --pkgs
is now breaking--pkgs
in this case though since neither the current dir .
or empty ''
works/project/wf
whereas main.py is in /project
. That way I could run pyflyte
from /project
and then set --pkgs
to wf
. This seems like a bug to me. I should be able to specify the cwd as --pkgs
(e.g. --pkgs .
)