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

threads-and-processes.md: AttributeError in exercises with multiprocessing #15

Open
wmotion opened this issue Jul 3, 2023 · 0 comments

Comments

@wmotion
Copy link
Contributor

wmotion commented Jul 3, 2023

Replicating the exercises

  1. https://esciencecenter-digital-skills.github.io/parallel-python-workbench/instructor/threads-and-processes.html#exercise-reimplement-calc_pi-to-use-a-queue-to-return-the-result
  2. https://esciencecenter-digital-skills.github.io/parallel-python-workbench/instructor/threads-and-processes.html#exercise-adapt-the-original-exercise-to-submit-tasks-to-a-pool

throws the error:

AttributeError: Can't get attribute 'calc_pi' on <module 'main' (built-in)>

while the cell seems to be at work (note the mark [*] below) somehow indefinitely (problem size: 10^6). Interrupting the kernel with Jupyter Lab causes a KeyboardInterrupt, not unexpectedly.
image

The attribute error is attributed to bad relationships between multiprocessing and iPython in https://stackoverflow.com/questions/41385708/multiprocessing-example-giving-attributeerror/42383397#42383397

Python 3.8.16
Jupyterlab 3.5.3
Conda 25.3.0

@wmotion wmotion changed the title threads-and-processes.md: attribute error in exercises with multiprocessing threads-and-processes.md: AttributeError in exercises with multiprocessing Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant