modelator-py
modelator-py copied to clipboard
ImportError: sys.meta_path is None, Python is likely shutting down
I am getting the following error on Python 3.10,
Exception ignored in: <function Pool.__del__ at 0x7fcbcb5e9630>
Traceback (most recent call last):
File "/home/XXXX/.cache/pypoetry/virtualenvs/modelator-py-5E8ZuFvv-py3.10/lib/python3.10/site-packages/multiprocess/pool.py", line 268, in __del__
File "/home/XXXX/.cache/pypoetry/virtualenvs/modelator-py-5E8ZuFvv-py3.10/lib/python3.10/site-packages/multiprocess/queues.py", line 375, in put
File "/home/XXXX/.cache/pypoetry/virtualenvs/modelator-py-5E8ZuFvv-py3.10/lib/python3.10/site-packages/multiprocess/reduction.py", line 54, in dumps
File "/home/XXXX/.cache/pypoetry/virtualenvs/modelator-py-5E8ZuFvv-py3.10/lib/python3.10/site-packages/multiprocess/reduction.py", line 42, in __init__
File "/home/XXXX/.cache/pypoetry/virtualenvs/modelator-py-5E8ZuFvv-py3.10/lib/python3.10/site-packages/dill/_dill.py", line 573, in __init__
ImportError: sys.meta_path is None, Python is likely shutting down
the problem goes away when I switch from pathos.multiprocessing to in-built multiprocessing library.
@danwt is there any specific reason you were using pathos?
Hey, I think there was! I can't remember the precise details but it was something to do with multiprocessing and pickling.
I think default python multiprocessing might require default pickling but many things cannot be easily pickled. Many people suggested to avoid the built in multiprocessing and use a library. I think pathos handled everything easily.
https://stackoverflow.com/questions/8804830/python-multiprocessing-picklingerror-cant-pickle-type-function
Btw, I see your using Python 3.10. Are you sure it won't cause problems. I think the project is for 3.9.9 and there was a good reason for that, which I can't remember :/ I think the reason might have been related to this issue.