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

Using multiprocessing.set_start_method() after importing numcodecs results in an exception #522

Open
mboquien opened this issue Apr 28, 2024 · 0 comments
Labels

Comments

@mboquien
Copy link

Minimal, reproducible code sample, a copy-pastable example if possible

import multiprocessing as mp
import numcodecs

mp.set_start_method("spawn")

Problem description

Trying to use multiprocessing.set_start_method() results in an exception:

Traceback (most recent call last):
  File "/home/mederic/scratch/start_method/test2.py", line 4, in <module>
    mp.set_start_method("spawn")
  File "/usr/lib/python3.12/multiprocessing/context.py", line 248, in set_start_method
    raise RuntimeError('context has already been set')
RuntimeError: context has already been set

It should be possible to set the start method even after importing the package.

Version and installation information

Please provide the following:

  • Value of numcodecs.__version__: 0.12.1
  • Version of Python interpreter: 3.12.3
  • Operating system (Linux/Windows/Mac): Archlinux
  • How NumCodecs was installed (e.g., "using pip into virtual environment", or "using conda"): system package
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants