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

can't import a local module from dask workers #187

Closed
rabernat opened this issue Mar 29, 2018 · 3 comments
Closed

can't import a local module from dask workers #187

rabernat opened this issue Mar 29, 2018 · 3 comments

Comments

@rabernat
Copy link
Member

In my research, I commonly write a module where I dump longer functions / classes and import it from my notebooks. This reduces clutter in the notebook. Perhaps these functions are used in multiple notebooks, but I don't consider them reusable / general / stable enough to actually package, distribute, etc. I imagine many people work this way.

As a concrete example, I have a file in my examples directory on pangeo.pydata.org called 'foo.py':

class Foo(object):
    def __init__(self):
        pass

I import this from a notebook and create an instance

import foo
f = foo.Foo()

Now I create a cluster and try to scatter this object

from dask.distributed import Client
from dask_kubernetes import KubeCluster
cluster = KubeCluster(n_workers=1)
client = Client(cluster)
client.scatter(f)

I get a long error, the gist of which is distributed.core - ERROR - No module named 'foo'.

What is confusing to me is that this example would work perfectly fine if I just defined Foo within a cell in the notebook.

We should think about how to support this sort of thing, because I feel like lots of people work this way.

Obviously related to other customizable environment issues such as #136, #133, #125, #67, etc.

@mrocklin
Copy link
Member

mrocklin commented Mar 29, 2018 via email

@stale
Copy link

stale bot commented Jun 25, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 25, 2018
@stale
Copy link

stale bot commented Jul 2, 2018

This issue has been automatically closed because it had not seen recent activity. The issue can always be reopened at a later date.

@stale stale bot closed this as completed Jul 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants