Open ogrisel opened 5 years ago
For the sake of completeness, I also tried with gunicorn and there is no problem:
$ gunicorn loky_wsgi_app:application
[2019-04-19 16:55:05 +0200] [17233] [INFO] Starting gunicorn 19.9.0
[2019-04-19 16:55:05 +0200] [17233] [INFO] Listening at: http://127.0.0.1:8000 (17233)
[2019-04-19 16:55:05 +0200] [17233] [INFO] Using worker: sync
[2019-04-19 16:55:05 +0200] [17236] [INFO] Booting worker with pid: 17236
I believe the difference is that uwsgi is probably a C binary that embeds a Python interpreter, therefore it's not possible to use sys.executable
to get a Python interpreter from the command line.
To fix this we basically need to find a python executable in the parent folder of the uwsgi
executable pointed by sys.executable
that can import loky
from the same installation path (under that is under site-packages folder).
If several Python versions are installed this might be a bit expensive to do so this should be cached.
Are there any known work-arounds? I am experiencing this issue as well.
The work-around I was able to find: https://stackoverflow.com/questions/54751297/uwsgi-and-joblib-semaphore-joblib-will-operate-in-serial-mode
If someone wants to volunteer to implement the strategy described here: https://github.com/joblib/loky/issues/207#issuecomment-485137208
When issuing a HTTP request on a uswgi app that uses loky one get the following error messages:
and then:
Steps to reproduce
Start the server:
and navigate to http://localhost:9999 .