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
Importing the astropy.table module prevents from setting a multiprocessing start method (caused by numcodecs in io.fits) #16351
Comments
That's weird - I cannot reproduce this (on Debian, astropy 6.0.0, python 3.11.8; rest shouldn't matter). Could it be something with python 3.12? |
In my case switching python 3.12 definitely triggers the bug. However I have been receiving sporadic reports of this issue with my code. While I was not always provided with the full information, one of the reporters had it on Python 3.11.8 on the win-amd64 platform. |
I couldn't reproduce either on macOS with Python 3.12.2 + astropy 7.0dev |
@mboquien just out of curiosity do you have dask installed? What is the output of 'pip freeze'? (Just to see what other packages might matter) |
Dask was installed but removing it does not solve the issue. To follow the idea, I have also removed many of the optional astropy packages, to no avail. I attach the list of packages if it can help. |
I went down the rabbit hole a little more and I believe I have found the culprit in the form of the numcodecs package. Now I am unsure whether the issue is with numcodecs itself or in the way astropy uses it. |
I don't think astropy uses it, not directly at least. |
I looked at that with |
Ah, I'm silly, I did my Anyway, back on topic: it would now seem that the bug is with
|
Indeed, importing numcodecs directly triggers the issue, which I have reported to them. Hopefully it will be addressed soon. In the meantime I know what to do to work around the issue. This being said, as a former Astropy packager for Archlinux, I think numcodecs should officially be listed as an optional dependency. Hidden dependencies can make issues more difficult to debug. In any case, thank you very much for your help! |
Thanks for giving us proper motivation to go hunting for rogue optional dependencies in astropy, I've been meaning to do this systematically but lacked a concret reason to ! |
Maybe worth trying out https://github.com/tweag/FawltyDeps ! |
@astrofrog - the particular use of |
Re: astropy/astropy/io/fits/hdu/compressed/_codecs.py Lines 19 to 29 in 0c06ac3
Is it worth adding an option for user to disable numcodecs? 🤷♀️ |
Description
Importing the
astropy.table
triggers an exception if one usesmultiprocessing.set_start_method()
afterwardsExpected behavior
Importing the
astropy.table
does not trigger an exception if one usesmultiprocessing.set_start_method()
afterwardsHow to Reproduce
The following code reproduces the issue.
It generates the following backtrace
Versions
The text was updated successfully, but these errors were encountered: