Skip to content
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

'No module named ...' when referencing external files from flow with DaskTaskRunner #16904

Open
cvetelinandreevdreamix opened this issue Jan 30, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@cvetelinandreevdreamix
Copy link

cvetelinandreevdreamix commented Jan 30, 2025

Bug summary

Hi, all,

I'm opening a new issue as it seems my comments on the closed one (#15783 ) are ignored.

I'm attaching a project you can use to reproduce the error
test-prefect-migration copy.zip

2024-12-06 12:06:12 ModuleNotFoundError: No module named 'common'

It happens when:
I deploy the flow to Minio. Use python deployment.py
I use a function from another module in the task I want to run with dask
If I run the flow from the local file system (python deployment.py) then it works fine
If I deploy and flow and I don't use a function imported from another module, then it works fine

My case is that I have a shared code between multiple flows and it is extracted in a shared module (common).

I can see the common folder is deployed to Minio.

P.S
The deployment of the flow to Minio doesn't work if I define the flow with the RemoteFileSystem class:

@flow(task_runner=DaskTaskRunner(), result_storage=RemoteFileSystem.load('minio-results'))

It works if i give just the slug

@flow(task_runner=DaskTaskRunner(), result_storage='remote-file-system/minio-results')

Let me know If you need more information. I need to migrate to prefect 3 and use the automations.

Thank you for your time!

Version info

Version:             2.20.9
API version:         0.8.4

Python version:      3.10.10
Git commit:          b101915a
Built:               Tue, Oct 1, 2024 12:41 PM
OS/Arch:             darwin/arm64
Profile:             pd-flow-local
Server type:         server

###### Requirements with Version Specifiers ######
prefect~=2.20.9
prefect_dask~=0.2.10
prefect-docker==0.4.0

Additional context

No response

@cvetelinandreevdreamix cvetelinandreevdreamix added the bug Something isn't working label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant