[issue35797] concurrent.futures.ProcessPoolExecutor does not work in venv on Windows

Antoine Pitrou report at bugs.python.org
Mon Jan 21 14:52:38 EST 2019


Antoine Pitrou <pitrou at free.fr> added the comment:

Hmm, if multiprocessing exhibits the problem, I wouldn't be surprised if some third-party libraries also do.  I think `sys.executable` should really point to the proper executable.

> But changing sys.executable to _not_ be the venv one will break anyone who doesn't correctly inherit environment variables (specifically, __PYVENV_LAUNCHER__, but this is deliberately not documented ;) ). 

Well, it will also break if other environment variables are required, e.g. PYTHONPATH.  Usually you want to inherit environment variables (including such fundamental stuff such as HOME), because you don't know which ones are actually required for a given workload.

So I think "breaking if environment variables are not inherited" is a less severe failure mode than this issue is.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35797>
_______________________________________


More information about the Python-bugs-list mailing list