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

documentation example is broken for imports #3598

Open
benclifford opened this issue Aug 22, 2024 · 0 comments
Open

documentation example is broken for imports #3598

benclifford opened this issue Aug 22, 2024 · 0 comments

Comments

@benclifford
Copy link
Collaborator

This came up on Slack from @cms21 and I have replicated it in my own environment.

The example in docs/userguide/examples used in https://parsl.readthedocs.io/en/stable/userguide/modularizing.html do not work right away: the guide does not talk about making the library modules importable (for example by placing on PYTHONPATH or installing in a package) and so attempting to run the examples fails with an import error on htex workers.

...
  File "/opt/homebrew/anaconda3/lib/python3.9/site-packages/dill/_dill.py", line 444, in load
    obj = StockUnpickler.load(self)
  File "/opt/homebrew/anaconda3/lib/python3.9/site-packages/dill/_dill.py", line 434, in find_class
    return StockUnpickler.find_class(self, module, name)
ModuleNotFoundError: No module named 'library'

History

Originally this example used the thread executor which does not have this problem, as it will be running in the submitting process which will have an import path likely to include the directory of the library.

PR #1719 changed this example to use the high throughput executor.

But sys.path is different inside the process_worker_pool and less likely to contain the library as described.

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

1 participant