cProfile causes pickling error when running multiprocessing Python code
The problem you’ve got here is that, by using -mcProfile, the module __main__ is cProfile (the actual entry point of the code), not your script. cProfile tries to fix this by ensuring that when your script runs, it sees __name__ as “__main__”, so it knows it’s being run as a script, not imported as a … Read more