-
Notifications
You must be signed in to change notification settings - Fork 47
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
Macos python 3.11/3.12 calling (some) subprocesses from executor #420
Comments
Hoping some more triage might help. I installed in dev mode and through some trials noticed that if I add
My error goes away. Perhaps that gives some hints at where the root of the issue might be? |
Thanks for the report and the hint. I can still reproduce with Python 3.13 on macOS. I will try to give it a look. |
For reference, import os
from time import sleep
from loky import get_reusable_executor
import multiprocessing as mp
from concurrent.futures import ProcessPoolExecutor
from subprocess import run
def call_program(k):
pid = os.getpid()
sleep(0.01)
print(run(["jupyter", "--version"]).check_returncode())
return pid
if __name__ == "__main__":
# executor = get_reusable_executor(max_workers=4, timeout=2)
executor = ProcessPoolExecutor(max_workers=4, mp_context=mp.get_context("spawn"))
res = executor.submit(call_program, 1) |
I took a look at the docstring of Since we are switching to I will try to wrap you reproducer as a non-regression test. |
Thank you for looking into/resolving this. Is anything else needed to get the ball rolling for this fix to be pulled into |
We need to release loky and then joblib. The loky release should happen soon. |
Closing this issue since #429 was merged with the fix and a non-regression test. |
Looking for some guidance on a strange error on Python 3.11/3.12 on MacOS with this executor. I experienced the issue using joblib but managed to reproduce here. The modified example is borrowed from the docs. Calling some programs with a subprocess inside the executor causes a strange python error:
Going back to Python 3.10 on the same system with the same code, it runs as expected. Code also runs fine on Windows/Linux Python 3.11/3.12.
The example below calls
jupyter
in a subprocess, but swapping this topython --version
orgcc --version
works just fine... (Seems to be these python "shims" likejupyter --version
orflake8 --version
that are failing...)Reproducing code:
On MacOS, python 3.11, 3.12 this raises with:
Tracing with
python -m trace -t test.py
shows the error:Environments created with:
mamba create --name test310 python=3.10 loky ipython jupyter
mamba create --name test311 python=3.11 loky ipython jupyter
mamba create --name test311 python=3.12 loky ipython jupyter
Any thoughts or ideas? Am I even in the right place!?
Thanks :)
The text was updated successfully, but these errors were encountered: