-
-
Notifications
You must be signed in to change notification settings - Fork 89
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 the process pool leads to error "ImportError: sys.meta_path is None, Python is likely shutting down" at exit #244
Comments
Happens to me too. This simple program gives me the exact same error:
Running Windows 10, pathos 0.2.9, Python 3.10.6 |
Same here for
pathos 0.2.9 Ubuntu 20.04.5 LTS |
Adding manual |
@xiay-lcw: that makes sense. I'll have to check whether the |
This issue still persists. Are there any updates planned?
Manually adding a pool.close() is not possible in my use case. Thanks in advance |
I'm unable to reproduce this error. I've checked the most recent versions of python 3.7 - 3.11 with the most recent versions of
How is the code being run? In the interpreter? In a file? In a jupyter notebook? |
may be related to #208... |
Running the code (pathos 0.2.9) in an apptainer instance with Python 3.9 on Debian |
@jaanckae (and anyone else): what do you expect to happen to the pool within a with context? Also, given some googling, I'm thinking that the current issue stems from the apptainer (and other containers people are using). Generally the error is seen when working with selenium and similar. |
I'm just looking for a way to continue my workflow. If I can safely proceed with ignoring this bug, then ok. But I'm not entirely sure this will not affect the rest of my code. What would be your suggestion in order to use it in combination with apptainer? |
@jaanckae: apparently it's an innocuous error, so you can likely ignore it. However, I believe you can use one of the two choices I mentioned above. Add a |
This happens at the end of the process, so it is best to place the lines of my example in a file.
My natural expectation was that it is calling In fact I was very surprised to hear that calling
Maybe I'm missing something, but what's the motivation of using a context manager then? If I understand it correctly, the implications of calling |
@bluenote10: thanks for your input. Each of the |
Yes that sounds like the most sensible solution. If I understand it correctly it would nicely handle the basic case of a single pool, and it avoid the two rather unexpected behaviours:
In that sense |
In testing, adding a Just, FYI, as
|
The following example works, but it leads to an ugly error message when the main process exits:
Output
The process return code is 0 though, i.e., it isn't a "real" error/crash.
The involved libraries should be relatively up-to-date.
The text was updated successfully, but these errors were encountered: