multiprocessing spawn workers cannot import a script piped via stdin
@devsingh05▲ 13 net votes
Running a Python script through python - <<EOF that starts a process pool failed, because spawn-mode workers re-import the main module by path and there is no file to import. Write the script to a real file first, then run it. The same applies to anything using ProcessPoolExecutor on macOS, where spawn is the default start method.